[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Enhance org-html--build-meta-info
From: |
Timothy E Chapman |
Subject: |
Re: [PATCH] Enhance org-html--build-meta-info |
Date: |
Wed, 16 Dec 2020 13:04:52 +0800 |
Hi Tom,
> Why not just use #+html_head:
> possibly with a macro to fill in variable values? That is fully
> extensible and doesn't overload keywords. For title, date, author,
> etc. those can have clearly defined mappings to the html, but
> everything else seems to be handled more sanely with #+html_head:. Am
> I missing something?
I doubt the use case that prompted me to make this an option is the
only one that would benefit, but it should give you an example of the
potential utility of this.
There's some metadata I /always/ want added to my exported documents.
Some of it is static (e.g. ("name" "theme-color" "#77aa99")), but I
also have opengraph metadata which is based on the title/author/etc.
See
https://tecosaur.github.io/emacs-config/config.html#extra-header-content,code--2
I can't imagine any non-irritating way to have this occur without
making use of this exposed functionality, and I doubt I'm the only one
who has something they'd like to do which makes use of this.
Thanks to the code cleanup / refactoring in the first commit, this
option is pretty trivial to expose, so I thought why not!
Does this help clarify the purpose to you?
Timothy.
p.s.I'd rather not have to copy-paste (evern by template expansion)
several lines like this into every file I export :cry:
#+HTML_HEAD: {{{meta_maybe_description}}}
#+MACRO: meta_maybe_description (eval (let ((description (delq nil
(org-element-map (org-element-parse-buffer) 'keyword (lambda (kw)
(when (string= "SUBTITLE" (org-element-property :key kw))
(org-element-property :value kw))))))) (if description (format "<meta
name=\"description\" content=\"%s\" />" (replace-regexp-in-string "\""
""" (org-html-encode-plain-text description)))) ""))
When I could just have this in my config:
(when (org-string-nw-p (plist-get info :description))
(list "name" "description"
(plist-get info :description))
Timothy E Chapman
tecosaur@gmail.com
tecosaur.com
On Wed, 16 Dec 2020 at 12:13, Tom Gillespie <tgbugs@gmail.com> wrote:
>
> A question from the slightly uninformed. Why not just use #+html_head:
> possibly with a macro to fill in variable values? That is fully
> extensible and doesn't overload keywords. For title, date, author,
> etc. those can have clearly defined mappings to the html, but
> everything else seems to be handled more sanely with #+html_head:. Am
> I missing something? Best,
> Tom
Re: [PATCH] Enhance org-html--build-meta-info, Jens Lechtenboerger, 2020/12/14
Re: [PATCH] Enhance org-html--build-meta-info, Jens Lechtenboerger, 2020/12/16
Re: [PATCH] Enhance org-html--build-meta-info, TEC, 2020/12/16
Re: [PATCH] Enhance org-html--build-meta-info, Jens Lechtenboerger, 2020/12/16
Re: [PATCH] Enhance org-html--build-meta-info, TEC, 2020/12/20
Re: [PATCH] Enhance org-html--build-meta-info, TEC, 2020/12/20
Re: [PATCH] Enhance org-html--build-meta-info, Jens Lechtenboerger, 2020/12/20