0

I tried to change html preamble by adding a new item to the nav bar, but publish is not updating the navigation bar.

I found this question, but I didn't know how to add a "force flag" to org-publish function. But I'm not sure if that's the problem.

My org-publish file below. I'm trying to add one more item to the list in the preamble.

(require 'ox-publish)
(setq org-publish-project-alist
      '(

("org-notes"
 :base-directory "~/org/"
 :base-extension "org"
 :publishing-directory "~/public_html/"
 :recursive t
 :publishing-function org-html-publish-to-html
 :headline-levels 4             ; Just the default for this project.
 :auto-preamble nil
 :html-preamble "<div id=\"navbar\"> <ul>
  <li><a href=\"index.html\">Home</a></li>
  <li><a href=\"blog.html\">Blog</a></li>
  <li><a href=\"/iletisim.html\">İletişim</a></li>
  <li><a href=\"/hakkinda.html\">Hakkında</a></li>
</ul>
<hr>
</div>
"
 )

("org-static"
 :base-directory "~/org/"
 :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
 :publishing-directory "~/public_html/"
 :recursive t
 :publishing-function org-publish-attachment
 )

("org" :components ("org-notes" "org-static"))

       ;; ... add all the components here (see below)...

      ))
0

1 Answer 1

1

You can use C-u M-x org-publish-current-project or C-u M-x org-publish-current-file to force the publishing of the current project (the project associated with the current file) or just the current file.

Alternatively, you can forego using timestamps for checking whether something is updated. Setting

(setq org-publish-use-timestamps-flag nil)

will always publish everything (which might not be a good idea if the project is large and takes a while to publish).

You can also clean out the timestamps to force publishing even if org-publish-use-timestamps-flag is set to the default t value. The timestamps are saved in the directory ~/.org-timestamps by default: check the value of org-publish-timestamp-directory for the actual value. You can just delete the <project>.cache file for your project (org-notes in your case).

2
  • Ok. Would deleting org-notes.cache file have any side effects?
    – zeynel
    Commented Nov 23, 2021 at 17:52
  • It will be regenerated the next time you publish, so I don't think so. It is only used to decide whether to publish or not.
    – NickD
    Commented Nov 23, 2021 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.