0

So I am trying to set a html preamble on my org-publish, and I am using the following code:

(setq org-publish-project-alist
      '(("org-notes"
         :base-directory "~/Projects/blog/"
         :base-extendion "org"
         :publishing-directory "~/Public/"
         :recursive t
         :makeindex t
         :html-preamble "This is just a test"
         :publishing-function org-html-publish-to-html)
        ("org-static"
         :base-directory "~/org/"
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
         :publishing-directory "~/Public/"
         :recursive t
         :publishing-function org-publish-attachment)
        ("org" :components ("org-notes" "org-static"))))

However, nothing shows up. Can anybody help me with this?

3
  • You have two :html-preamble settings: does anything happen if you get rid of the second one?
    – NickD
    Commented May 16, 2020 at 17:17
  • That was a copy/paste mistake. I just checked it and it was not it.
    – user28912
    Commented May 16, 2020 at 17:20
  • So I copied your settings (with changes to the paths of course), created a dummy org file foo.org in the blog directory and published the project. I get a foo.html file in the Public directory that contains this: <body> <div id="preamble" class="status"> This is just a test </div>... - so AFAICT it works fine. If you cannot reproduce this, I'd suggest you start with emacs -q and possibly a very minimal init file, if you need one to load Org mode (if you are using the Org mode that's built-in to emacs, you should not need any init file) and try publishing.
    – NickD
    Commented May 16, 2020 at 20:10

1 Answer 1

1

So it seems that the problem was that, because I was making no changes on the posts, org-mode saw no need to recompile it. To overcome this, just add the force flag to the org-publish function.

1
  • This gets me all the time. It would be cool if the caching mechanism could check whether the project in org-publish-project-alist has changed since the last invocation. Commented Feb 23, 2021 at 18:54

Your Answer

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