Org: some org config needs to wait for ox-html
This commit is contained in:
parent
f4677a113c
commit
9d24c2df23
19
config.org
19
config.org
|
@ -5786,6 +5786,9 @@ the final documents.
|
|||
(ox-extras-activate '(ignore-headlines))
|
||||
#+end_src
|
||||
**** Exporting to HTML
|
||||
:PROPERTIES:
|
||||
:header-args:emacs-lisp: :noweb-ref ox-html-conf
|
||||
:END:
|
||||
I want to tweak a whole bunch of things. While I'll want my tweaks almost all
|
||||
the time, occasionally I may want to test how something turns out using a more
|
||||
default config. With that in mind, a global minor mode seems like the most
|
||||
|
@ -5812,6 +5815,15 @@ the vast majority of the change in behaviour comes from switch statements in:
|
|||
org-html-meta-tags #'org-html-meta-tags-default
|
||||
org-html-checkbox-type 'html)))
|
||||
#+end_src
|
||||
|
||||
There are quite a few instances where I want to modify variables defined in
|
||||
=ox-html=, so we'll wrap the contents of this section in an ~(after! ox-html ...)~
|
||||
block.
|
||||
#+begin_src emacs-lisp :noweb yes :noweb-ref org-conf
|
||||
(after! ox-html
|
||||
<<ox-html-conf>>
|
||||
)
|
||||
#+end_src
|
||||
***** Extra header content
|
||||
We want to tack on a few more bits to the start of the body. Unfortunately, there
|
||||
doesn't seem to be any nice variable or hook, so we'll just override the
|
||||
|
@ -5944,8 +5956,7 @@ of contents as a string, or nil if it is empty."
|
|||
|
||||
Lastly, let's pile on some metadata. This gives my pages nice embeds.
|
||||
#+begin_src emacs-lisp
|
||||
(after! ox-html
|
||||
(defun org-html-meta-tags-fancy (info)
|
||||
(defun org-html-meta-tags-fancy (info)
|
||||
"Use the INFO plist to construct the meta tags, as described in `org-html-meta-tags'."
|
||||
(let ((title (org-html-plain-text
|
||||
(org-element-interpret-data (plist-get info :title)) info))
|
||||
|
@ -5978,9 +5989,9 @@ Lastly, let's pile on some metadata. This gives my pages nice embeds.
|
|||
(list "property" "og:article:author:last_name" (cadr (s-split-up-to " " author 2))))
|
||||
(list "property" "og:article:published_time" (format-time-string "%FT%T%z")))))
|
||||
|
||||
(unless (functionp #'org-html-meta-tags-default)
|
||||
(unless (functionp #'org-html-meta-tags-default)
|
||||
(defalias 'org-html-meta-tags-default #'ignore))
|
||||
(setq org-html-meta-tags #'org-html-meta-tags-fancy))
|
||||
(setq org-html-meta-tags #'org-html-meta-tags-fancy)
|
||||
#+end_src
|
||||
***** Custom CSS/JS
|
||||
The default org HTML export is ... alright, but we can really jazz it up.
|
||||
|
|
Loading…
Reference in a new issue