summaryrefslogtreecommitdiff
path: root/ox-haunt.el
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2022-06-01 21:43:32 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2022-06-01 21:43:32 -0400
commit4d585c51d5701b4d43c02db78c7032658cae47fd (patch)
treed814db92f94e947aad7dabd9fa36ea57ef729a77 /ox-haunt.el
parentbd83688c8d78f61e534a57874b41a2d4cd3a42e2 (diff)
Only handle `:haunt-metadata' when present
Diffstat (limited to 'ox-haunt.el')
-rw-r--r--ox-haunt.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/ox-haunt.el b/ox-haunt.el
index 5d42f98..1e5e64d 100644
--- a/ox-haunt.el
+++ b/ox-haunt.el
@@ -60,6 +60,7 @@
This can be specified on a per-file basis with the 'HAUNT_BASE_DIR' keyword."
:type 'string)
+;; Notably, this excludes :haunt-metadata, which we handle separately.
(defcustom ox-haunt-recognized-metadata '(:title :date :tags)
"A list of keywords to include in the Haunt metadata section."
:type '(list symbol))
@@ -149,8 +150,11 @@ INFO is the current state of the export process, as a plist."
(insert (format "%s: %s\n"
(substring (symbol-name keyword) 1)
(ox-haunt--keyword-as-string info keyword)))))
- (dolist (p (read (ox-haunt--keyword-as-string info :haunt-metadata)))
- (insert (format "%s: %s\n" (car p) (cdr p))))
+ ;; Handle :haunt-metadata, which we deliberately exclude from
+ ;; `ox-haunt-recognized-metadata'.
+ (when (plist-get info :haunt-metadata)
+ (dolist (p (read (ox-haunt--keyword-as-string info :haunt-metadata)))
+ (insert (format "%s: %s\n" (car p) (cdr p)))))
(buffer-string))
"---\n"
;; Output the article contents.