How to format postamble to HTML export with Org-mode?

I am creating a website with org-mode and would like to format postamble so that it simply shows the created date and 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; -*- 

In this case, postamble is formatted as follows:

Date: March 16, 2012

Org Version 7.8.03 with Emacs 24

Validate XHTML 1.0

built vertically, which I don't really like.

+6
source share
2 answers

The reason it does not accept your own postamble is because you need to use the #+BIND: syntax #+BIND: for the variable to be used when exporting. (See Export Options )

After changing this parameter, I also had to slightly adjust the format so that it corresponded to the required syntax. The default value for org-export-html-postamble-format :

 (("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 will need to do the following to enable it (as close as possible to this 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 will be exported 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 that you need to customize your stylesheet using p.postamble { text-align: center; } p.postamble { text-align: center; } to get centering.

+9
source

The simplest configuration you need:

  (setq org-html-postamble "Your postamble here")

This establishes a direct connection.

To find out what options you have for your postamble, type:

  Ch v org-html-postamble-format

You will see a list:

  % t stands for the title.
 % a stands for the author name.
 % e stands for the author email.
 % d stands for the date.
 % c will be replaced by `org-html-creator-string '.
 % v will be replaced by `org-html-validation-link '.
 % T will be replaced by the export time.
 % C will be replaced by the last modification time.
+3
source

Source: https://habr.com/ru/post/910942/


All Articles