emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Vladimir Alexiev <vladimir.alexiev@ontotext.com>
To: emacs-orgmode@gnu.org
Subject: Ability to add logo to HTML export
Date: Thu, 23 Mar 2023 18:14:25 +0200	[thread overview]
Message-ID: <CAMv+wg6RZN1EQH780vXQPSbfcBCMhfabHbyKkzQe4vNw=5F37w@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1385 bytes --]

Some projects have a logo, which one may want to add to the beginning of a
HTML document.
Eg like this (before authors and Title):
[image: image.png]

Right now I have to resort to a bad kludge to do that: a local variable in
the org file:

#+comment: -*- org-html-preamble: "<p class='author'>Author:
%a<br/>(%e)</p><p class='date'>Date: %d</p><p><img
src='./img/SemBSDD-Logo-400px.png'/></p>" -*-

And also this in my org setup:

(put 'org-html-preamble 'safe-local-variable 'stringp)

I looked at

(org-export-define-backend 'html
  :options-alist
    (:html-preamble nil "html-preamble" org-html-preamble)

and the help for org-export-options-alist:
this word "html-preamble" corresponds to:

OPTION is a string that could be found in an #+OPTIONS: line.

So I tried this, but it had no effect"

#+OPTION: html-preamble: "<p class='author'>Author: %a<br/>(%e)</p><p
class='date'>Date: %d</p><p><img src='./img/SemBSDD-Logo-400px.png'/></p>"

Minor note: normally, I distribute the standard variables between preamble
and postamble as follows:

(setq
 org-html-preamble-format '(("en" "<p class=\"author\">Author: %a (%e)</p>
<p class=\"date\">Date: %d</p>"))
 org-html-postamble t                   ; was 'auto which inserts author,
date: but I want those in preamble
 org-html-postamble-format  '(("en" "<p class=\"creator\">Exported by %c</p>
<p class=\"validation\">%v</p>"))
)

[-- Attachment #1.2: Type: text/html, Size: 2236 bytes --]

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 55404 bytes --]

             reply	other threads:[~2023-03-23 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 16:14 Vladimir Alexiev [this message]
2023-03-24 11:54 ` Ability to add logo to HTML export Ihor Radchenko
2023-03-24 13:43   ` Vladimir Alexiev
2023-03-24 14:06     ` Ihor Radchenko
2023-03-26 20:05       ` Vladimir Alexiev

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='CAMv+wg6RZN1EQH780vXQPSbfcBCMhfabHbyKkzQe4vNw=5F37w@mail.gmail.com' \
    --to=vladimir.alexiev@ontotext.com \
    --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).