about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-11-13T15·42+0100
committerVincent Ambo <tazjin@gmail.com>2017-11-13T15·42+0100
commit3e37d3990d23efee87572c07b8ae9b00c64eab79 (patch)
treeff152c52fa9fe359a823bfb17f64cb7719620bd7
parent07583c2b1946811ca5bee5f5ef45313b03a233a7 (diff)
refactor: Load preamble from an HTML file, too.
-rw-r--r--blog.el8
-rw-r--r--preamble.html6
2 files changed, 10 insertions, 4 deletions
diff --git a/blog.el b/blog.el
index accfda07888d..d968c9ce261b 100644
--- a/blog.el
+++ b/blog.el
@@ -20,15 +20,13 @@
   :group 'elblog
   :type 'string)
 
-;; org-mode settings need to be configured a certain way for elblog's HTML
-;; templating to work correctly.
 (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" "<header><h1><a class=\"unstyled-link\" href=\"/\">Tazjin&#39;s blog</a></h1><hr></header>")))
+  (setq org-html-preamble-format `(("en" ,(f-read-text "preamble.html"))))
   (setq org-html-postamble-format `(("en" ,(f-read-text "postamble.html")))))
 
 ;; Article fetching & rendering functions
@@ -85,3 +83,5 @@
 (defun stop-elblog ()
   (interactive)
   (elnode-stop elblog-port))
+
+(provide 'elblog)
diff --git a/preamble.html b/preamble.html
new file mode 100644
index 000000000000..38fe179c58d8
--- /dev/null
+++ b/preamble.html
@@ -0,0 +1,6 @@
+<header>
+  <h1>
+    <a class="unstyled-link" href="/">Tazjin&#39;s blog</a>
+  </h1>
+  <hr>
+</header>