emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Exporting html: any way to customize format h1 class="title"?


From: Matt Lundin
Subject: [O] Exporting html: any way to customize format h1 class="title"?
Date: Sat, 26 Jul 2014 00:14:02 -0500
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux)

I greatly appreciate the new export backends (thanks Nicolas!). The
filter functions are fantastic.

One thing that I'm having difficulty finding, however, is some way to
modify the content of the <title> and <h1 class="title"> headings in the
html.

The function org-html-template hard-codes the formatting of the title:

,----[ox-html.el [lines 1864-1865]
|    (let ((title (plist-get info :title)))
|      (format "<h1 class=\"title\">%s</h1>\n" (org-export-data (or title "") 
info)))
`----

AFAICT, there is no filter that would enable one to bypass the <h1> tag
her or to give it different text than the <title> tag.

The reason I ask is because I would like to omit the h1 header on the
home page of my website or to give it different text than that given to
<title>. Since my site will display a banner with my name at the top of
all pages, I would prefer to avoid the redundancy of "Name" or a
pedantic "Home" at the top the home page.[fn:1]

On other pages, it would also be nice to be able to give different text
to the <title> and <h1 class="title"> tags. For instance, many sites
append the site name to the page title in the <title> tag.

In the old export backends there were hooks that allowed some small
modifications on the html after exporting it However, the two hooks of
the new export backend hooks (org-export-before-processing-hook,
org-export-before-parsing-hook) are called on copies of the org source.

Are there any clever means that I've missed to modify the title tags?

Thanks,
Matt

Footnotes:

[fn:1] I know I can hide h1.title it with "display:none;" in the CSS,
but I'd prefer not to do so, since it seems that hiding a major element
can seem spammy to search engines. And now that I notice it, the
org-mode site uses "display: none" in its css file to hide h1.title on
all pages. Wouldn't it be easier to have an option in ox-html.el to omit
the tag from the exported file?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]