Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I format the postamble in HTML-export with Org-mode?

Tags:

html

org-mode

I am creating a website with org-mode and would like to format the postamble so it just shows the date created and the creator at the bottom of the page, in the center, and is horizontal.

In my .emacs I have

(setq org-export-html-postamble-format "Last Updated %d. Created by %c")

and at the top of my index.org (and all other pages) I have

# -*- org-export-html-postamble:t; -*-

The postamble is formatted like this currently:

Date: 16 March 2012

Org version 7.8.03 with Emacs version 24

Validate XHTML 1.0

arrayed vertically, which I don't very much like.

like image 952
Zach Avatar asked Mar 16 '12 18:03

Zach


1 Answers

The reason it isn't accepting your own postamble is because you have to use #+BIND: syntax for the variable so that it is used on export. (See Export Options)

After changing that setting I also had to adjust your format slightly to fit the required syntax. The default value for org-export-html-postamble-format is:

(("en" "<p class=\"author\">Author: %a (%e)</p>
<p class=\"date\">Date: %d</p>
<p class=\"creator\">Generated by %c</p>
<p class=\"xhtml-validation\">%v</p>
"))

So you'd have to do the following to have it included (matching as closely as possible to that format):

(setq org-export-html-postamble-format 
      '(("en" "<p class=\"postamble\">Last Updated %d. Created by %c</p>")))

This however will not center your text, it exports as follows:

<div id="postamble">
<p class="postamble">Last Updated 2012-03-16 16:22:03 Eastern Daylight Time. Created by Org version 7.8.03 with Emacs version 24
</div>

I believe you'd have to set up a custom stylesheet with p.postamble { text-align: center; } to get the centering to work.

like image 170
Jonathan Leech-Pepin Avatar answered Oct 15 '22 18:10

Jonathan Leech-Pepin