about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-11-13T15·49+0100
committerVincent Ambo <tazjin@gmail.com>2017-11-13T15·49+0100
commit5065f5395bc9caf094e5218a6a5935eb25046e6d (patch)
treef0dd6d9992fe13f033a9f2cb6ead221e60d7e279
parent3e37d3990d23efee87572c07b8ae9b00c64eab79 (diff)
feat: Make blog-title configurable in preamble
-rw-r--r--blog.el13
-rw-r--r--preamble.html2
2 files changed, 13 insertions, 2 deletions
diff --git a/blog.el b/blog.el
index d968c9ce261b..4e515a3cd5b0 100644
--- a/blog.el
+++ b/blog.el
@@ -20,13 +20,24 @@
   :group 'elblog
   :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 ()
   "Configure org-mode settings for elblog's HTML templating to work correctly."
   (setq org-html-postamble t)
   (setq org-html-doctype "html5")
   (setq org-html-head-include-scripts nil)
   (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")))))
 
 ;; Article fetching & rendering functions
diff --git a/preamble.html b/preamble.html
index 38fe179c58d8..be74b9207e72 100644
--- a/preamble.html
+++ b/preamble.html
@@ -1,6 +1,6 @@
 <header>
   <h1>
-    <a class="unstyled-link" href="/">Tazjin&#39;s blog</a>
+    <a class="unstyled-link" href="/">%s</a>
   </h1>
   <hr>
 </header>