all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Exporting html: any way to customize format h1 class="title"?
@ 2014-07-26  5:14 Matt Lundin
  2014-07-26  7:58 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Lundin @ 2014-07-26  5:14 UTC (permalink / raw)
  To: Org Mode

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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-26 12:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-26  5:14 Exporting html: any way to customize format h1 class="title"? Matt Lundin
2014-07-26  7:58 ` Nicolas Goaziou
2014-07-26 12:34   ` Matt Lundin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.