diff --git a/doc/ox-hugo-manual.org b/doc/ox-hugo-manual.org index 3594643..88dea50 100644 --- a/doc/ox-hugo-manual.org +++ b/doc/ox-hugo-manual.org @@ -9,7 +9,7 @@ Markdown]] flavor. [[http://gohugo.io/content/sections/][here]] for more information on Hugo sections. It is common for this property to be set to =posts= or =blog=. -- HUGO_EXPORT_DIR :: Root directory of the source for the Hugo site. +- HUGO_BASE_DIR :: Root directory of the source for the Hugo site. If this is set to =~/hugo/=, the exported Markdown files will be saved to =~/hugo/content//= directory. By [[http://gohugo.io/content/organization/][default]], the Markdown files reside in a hierarchy under the =content/= diff --git a/ox-hugo.el b/ox-hugo.el index 3d72576..b6a1e36 100644 --- a/ox-hugo.el +++ b/ox-hugo.el @@ -107,7 +107,7 @@ directory where all Hugo posts should go by default." (:hugo-url "HUGO_URL" nil nil) ;; Non-front-matter options (:hugo-section "HUGO_SECTION" nil org-hugo-default-section-directory) - (:hugo-export-dir "HUGO_EXPORT_DIR" nil nil) + (:hugo-base-dir "HUGO_BASE_DIR" nil nil) (:hugo-static-images "HUGO_STATIC_IMAGES" nil "images"))) @@ -222,13 +222,13 @@ PATH is the path to the image or pdf attachment. INFO is a plist used as a communication channel." (message "[ox-hugo DBG] The Hugo sectioimage dir is: %s" (plist-get info :hugo-static-images) ) (message "[ox-hugo DBG] The Hugo section is: %s" (plist-get info :hugo-section) ) - (message "[ox-hugo DBG] The Hugo export dir is: %s" (plist-get info :hugo-export-dir) ) + (message "[ox-hugo DBG] The Hugo base dir is: %s" (plist-get info :hugo-base-dir) ) (let* ((full-path (file-truename path)) (exportables '("jpg" "jpeg" "tiff" "png" "pdf" "odt" )) (file-name (file-name-nondirectory path)) (image-export-dir (concat - (file-name-as-directory (plist-get info :hugo-export-dir)) + (file-name-as-directory (plist-get info :hugo-base-dir)) "static/" (file-name-as-directory (plist-get info :hugo-static-images)) )) @@ -413,14 +413,14 @@ Return output file's name." 'hugo subtreep visible-only) (org-export--get-buffer-attributes) (org-export-get-environment 'hugo subtreep))) - (export-dir-path (if (null (plist-get info :hugo-export-dir)) - (user-error "It is mandatory to set the HUGO_EXPORT_DIR property") - (file-name-as-directory (plist-get info :hugo-export-dir)))) + (base-dir (if (null (plist-get info :hugo-base-dir)) + (user-error "It is mandatory to set the HUGO_BASE_DIR property") + (file-name-as-directory (plist-get info :hugo-base-dir)))) (content-dir "content/") (section-dir (if (null (plist-get info :hugo-section)) (user-error "It is mandatory to set the HUGO_SECTION property") (file-name-as-directory (plist-get info :hugo-section)))) - (pub-dir (let ((dir (concat export-dir-path content-dir section-dir))) + (pub-dir (let ((dir (concat base-dir content-dir section-dir))) (make-directory dir :parents) ;Create the directory if it does not exist dir)) (outfile (org-export-output-file-name ".md" subtreep pub-dir))) diff --git a/tests/org/prop-drawer-parsing/prop-drawer-parsing.org b/tests/org/prop-drawer-parsing/prop-drawer-parsing.org index 5751c52..f9254c7 100644 --- a/tests/org/prop-drawer-parsing/prop-drawer-parsing.org +++ b/tests/org/prop-drawer-parsing/prop-drawer-parsing.org @@ -1,5 +1,5 @@ #+TITLE: My Blog -#+HUGO_EXPORT_DIR: ../../md/ +#+HUGO_BASE_DIR: ../../md/ #+HUGO_SECTION: posts # 1. Load `ox-hugo' diff --git a/tests/org/small1/small1.org b/tests/org/small1/small1.org index 0d4ca1e..3d5ddaa 100644 --- a/tests/org/small1/small1.org +++ b/tests/org/small1/small1.org @@ -1,5 +1,5 @@ #+TITLE: My Blog -#+HUGO_EXPORT_DIR: ../../md/ +#+HUGO_BASE_DIR: ../../md/ #+HUGO_SECTION: posts # 1. Load `ox-hugo' diff --git a/tests/org/tags-and-keywords/tags-and-keywords.org b/tests/org/tags-and-keywords/tags-and-keywords.org index 7d3ce0b..4050e6e 100644 --- a/tests/org/tags-and-keywords/tags-and-keywords.org +++ b/tests/org/tags-and-keywords/tags-and-keywords.org @@ -1,5 +1,5 @@ #+TITLE: My Blog -#+HUGO_EXPORT_DIR: ../../md/ +#+HUGO_BASE_DIR: ../../md/ #+KEYWORDS: alpha beta # 1. Load `ox-hugo'