emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Exporting html: any way to customize format h1 class="title"?
Date: Sat, 26 Jul 2014 00:14:02 -0500	[thread overview]
Message-ID: <87vbqkr9b9.fsf@fastmail.fm> (raw)

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	other threads:[~2014-07-26  5:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-26  5:14 Matt Lundin [this message]
2014-07-26  7:58 ` Exporting html: any way to customize format h1 class="title"? Nicolas Goaziou
2014-07-26 12:34   ` Matt Lundin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbqkr9b9.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).