diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2023-07-24 20:01:32 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2023-07-24 20:01:32 -0400 |
| commit | 1c8c70e3173f98206768c15cb2e4de706559f151 (patch) | |
| tree | bcd4fec8e6f6223bdb8cdc3da36eeca50fa0317f | |
| parent | d32c4b1ab258dc34ca7e713152a274eab35d2608 (diff) | |
Enable customization of where rendered documents are written to
| -rw-r--r-- | ox-haunt.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ox-haunt.el b/ox-haunt.el index 7589c1f..6656328 100644 --- a/ox-haunt.el +++ b/ox-haunt.el @@ -48,6 +48,7 @@ '((:tags "TAGS" nil nil) (:haunt-metadata "HAUNT_METADATA" nil nil) (:haunt-base-dir "HAUNT_BASE_DIR" nil ox-haunt-base-dir) + (:haunt-posts-dir "HAUNT_POSTS_DIR" nil ox-haunt-posts-dir) (:haunt-images-dir "HAUNT_IMAGES_DIR" nil ox-haunt-images-dir))) (defgroup org-export-haunt nil @@ -65,6 +66,11 @@ This can be specified on a per-file basis with the 'HAUNT_BASE_DIR' keyword." "A list of keywords to include in the Haunt metadata section." :type '(list symbol)) +(defcustom ox-haunt-posts-dir "/posts/" + "The default path to copy rendered posts to. +This can be specified on a per-file basis with the 'HAUNT_POSTS_DIR' keyword." + :type 'string) + (defcustom ox-haunt-images-dir "/images/" "The default path to copy images to. This can be specified on a per-file basis with the 'HAUNT_IMAGES_DIR' keyword." @@ -244,6 +250,7 @@ Return output file's name." (org-export--get-buffer-attributes) (org-export-get-environment 'haunt subtreep))) (dest-path (plist-get info :haunt-base-dir)) + (posts-path (plist-get info :haunt-posts-dir)) (images-path (plist-get info :haunt-images-dir)) (subtree-metadata (when subtreep (ox-haunt--get-valid-subtree-metadata)))) @@ -259,12 +266,13 @@ Return output file's name." org-html-extension "html"))) (file (org-export-output-file-name extension subtreep)) - (file (concat dest-path "/posts/" file)) + (file (concat dest-path posts-path file)) (org-export-coding-system org-html-coding-system)) (org-export-to-file 'haunt file async subtreep visible-only body-only ;; Necessary to propagate a buffer-local value for `ox-haunt-base-dir'. (append `(:haunt-base-dir ,dest-path) + `(:haunt-posts-dir ,posts-path) `(:haunt-images-dir ,images-path) subtree-metadata ext-plist))))))) |