feat: Make blog-title configurable in preamble
This commit is contained in:
parent
3e37d3990d
commit
5065f5395b
2 changed files with 13 additions and 2 deletions
13
blog.el
13
blog.el
|
@ -20,13 +20,24 @@
|
||||||
:group 'elblog
|
:group 'elblog
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom elblog-title "Elblog"
|
||||||
|
"Title text for this elblog instance"
|
||||||
|
:group 'elblog
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
|
;; HTML templating setup
|
||||||
|
|
||||||
|
(defun template-preamble ()
|
||||||
|
"Templates the preamble snippet with the correct blog title."
|
||||||
|
(format (f-read-text "preamble.html") elblog-title))
|
||||||
|
|
||||||
(defun configure-org-html-export ()
|
(defun configure-org-html-export ()
|
||||||
"Configure org-mode settings for elblog's HTML templating to work correctly."
|
"Configure org-mode settings for elblog's HTML templating to work correctly."
|
||||||
(setq org-html-postamble t)
|
(setq org-html-postamble t)
|
||||||
(setq org-html-doctype "html5")
|
(setq org-html-doctype "html5")
|
||||||
(setq org-html-head-include-scripts nil)
|
(setq org-html-head-include-scripts nil)
|
||||||
(setq org-html-style-default (f-read-text "blog.css"))
|
(setq org-html-style-default (f-read-text "blog.css"))
|
||||||
(setq org-html-preamble-format `(("en" ,(f-read-text "preamble.html"))))
|
(setq org-html-preamble-format `(("en" ,(template-preamble))))
|
||||||
(setq org-html-postamble-format `(("en" ,(f-read-text "postamble.html")))))
|
(setq org-html-postamble-format `(("en" ,(f-read-text "postamble.html")))))
|
||||||
|
|
||||||
;; Article fetching & rendering functions
|
;; Article fetching & rendering functions
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<header>
|
<header>
|
||||||
<h1>
|
<h1>
|
||||||
<a class="unstyled-link" href="/">Tazjin's blog</a>
|
<a class="unstyled-link" href="/">%s</a>
|
||||||
</h1>
|
</h1>
|
||||||
<hr>
|
<hr>
|
||||||
</header>
|
</header>
|
||||||
|
|
Loading…
Reference in a new issue