Greetings,

New to the list, and this is my first post.  I hope it's ok.

I'm experiencing an issue when trying to use org-publish.

In attempting to convert the divs generated for preamble, content, and postamble, by specifying, what I believe to be the appropriate setting within org-publish-project-alist :


   :html-divs '((preamble "header" :id "preamble")
              (content "main" :id "content")
             (postamble "footer" :id "postamble"))


Instead of generating <header id="preamble"...</header>, <main id="content">...</main>, and <footer id="postamble">...</footer>, as expected, I am generating: <nil id="nil" class="status">...</nil>, <nil id="nil" class="content">...</nil>, and <nil id="nil" class="status">...</nil>, respectively.

This also happens when I use this approach instead:


  :html-divs '((preamble . "<header id=\"preamble\">")
            (content "<main id=\"content\">")
            (postamble "<footer id=\"postamble\">"))


I am doing a slightly weird thing in that I am using the following code to pull in a header.org and footer.org file, and extract the html code contained within using org-export and add these values to the appropriate :html-{preamble,postamble} variables as shown below:

This is the function:

    (defun get-org-component-contents (component)
      "Retrieve the HTML contents of the specified org component."
      (with-temp-buffer
        (insert-file-contents (concat "./components/" component ".org"))
        (org-export-to-buffer 'html "*Org HTML Export*" nil nil nil t)
        ;; (insert-file-contents (concat "./components/" component ".html"))
        (buffer-string)))

and I set the variables:


    (setq header-contents (get-org-component-contents "header"))
    (setq footer-contents (get-org-component-contents "footer"))


then define them into the org-publish-project-alist like so:

   :html-preamble ,header-contents
   :html-postamble ,footer-contents

This works seemlessly when I don't try to change the :html-div elements.


Is this me doing something wrong here or could this be a potential issue with org-publish?


I'm trying to achieve some modularity to the way i do things and must confess, i've only recently begun to start wrapping my head around emacs-lisp, so it's more likely to be a me problem.

Any pointers you can offer are appreciated.



Regards,



Cooper.

Attachment: OpenPGP_0xFE14D7FDC31BFF50.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to