diff --git a/ox-hugo.el b/ox-hugo.el index 0f90814..8e2ad38 100644 --- a/ox-hugo.el +++ b/ox-hugo.el @@ -644,6 +644,7 @@ newer." :options-alist '(;; Variables not setting the front-matter directly (:with-toc nil "toc" org-hugo-export-with-toc) (:section-numbers nil "num" org-hugo-export-with-section-numbers) + (:author "AUTHOR" nil org-export-with-author newline) (:creator "CREATOR" nil org-hugo-export-creator-string) (:with-smart-quotes nil "'" nil) ;Don't use smart quotes; that is done automatically by Blackfriday (:with-special-strings nil "-" nil) ;Don't use special strings for ndash, mdash; that is done automatically by Blackfriday @@ -656,14 +657,12 @@ newer." (:hugo-bundle "HUGO_BUNDLE" nil nil) (:hugo-base-dir "HUGO_BASE_DIR" nil nil) (:hugo-code-fence "HUGO_CODE_FENCE" nil t) ;Prefer to generate triple-backquoted Markdown code blocks by default. - (:hugo-menu "HUGO_MENU" nil nil) - (:hugo-menu-override "HUGO_MENU_OVERRIDE" nil nil) (:hugo-use-code-for-kbd "HUGO_USE_CODE_FOR_KBD" nil org-hugo-use-code-for-kbd) (:hugo-prefer-hyphen-in-tags "HUGO_PREFER_HYPHEN_IN_TAGS" nil org-hugo-prefer-hyphen-in-tags) (:hugo-allow-spaces-in-tags "HUGO_ALLOW_SPACES_IN_TAGS" nil org-hugo-allow-spaces-in-tags) (:hugo-auto-set-lastmod "HUGO_AUTO_SET_LASTMOD" nil org-hugo-auto-set-lastmod) - (:hugo-custom-front-matter "HUGO_CUSTOM_FRONT_MATTER" nil nil) - (:hugo-blackfriday "HUGO_BLACKFRIDAY" nil nil) + (:hugo-custom-front-matter "HUGO_CUSTOM_FRONT_MATTER" nil nil space) + (:hugo-blackfriday "HUGO_BLACKFRIDAY" nil nil space) (:hugo-front-matter-key-replace "HUGO_FRONT_MATTER_KEY_REPLACE" nil nil space) ;; Front matter variables @@ -697,8 +696,11 @@ newer." (:hugo-linktitle "HUGO_LINKTITLE" nil nil) ;; markup (:hugo-markup "HUGO_MARKUP" nil nil) ;default is "md" + ;; menu + (:hugo-menu "HUGO_MENU" nil nil space) + (:hugo-menu-override "HUGO_MENU_OVERRIDE" nil nil space) ;; outputs - (:hugo-outputs "HUGO_OUTPUTS" nil nil) + (:hugo-outputs "HUGO_OUTPUTS" nil nil space) ;; publishDate (:hugo-publishdate "HUGO_PUBLISHDATE" nil nil) ;; slug @@ -718,7 +720,7 @@ newer." ;; override inherited categories and Org-style ;; categories (Org-style tags with "@" prefix). ;; resources - (:hugo-resources "HUGO_RESOURCES" nil nil) + (:hugo-resources "HUGO_RESOURCES" nil nil space) ;; title ;; "title" is parsed from the Org #+TITLE or the subtree heading. ;; type @@ -2237,8 +2239,9 @@ INFO is a plist used as a communication channel." (org-string-nw-p (org-export-data (plist-get info :author) info)))) (when author-raw - ;; Comma-separated multiple authors - (let ((author-list-1 (org-split-string author-raw ","))) + ;; Multiple authors can be comma or + ;; newline separated. + (let ((author-list-1 (org-split-string author-raw "[,\n]"))) ;; Don't allow spaces around author names. (mapcar #'org-trim author-list-1)))))) (creator (and (plist-get info :with-creator) diff --git a/test/site/content-org/keyword-collection.org b/test/site/content-org/keyword-collection.org new file mode 100644 index 0000000..c7a2af6 --- /dev/null +++ b/test/site/content-org/keyword-collection.org @@ -0,0 +1,90 @@ +#+TITLE: Keyword Collection + +#+HUGO_BASE_DIR: ../ + +# Authors +#+AUTHOR: firstname1 lastname1 +#+AUTHOR: firstname2 lastname2, firstname3 lastname3 + +# Note that #+FILETAGS won't work in file-based exports (like this one). +# https://ox-hugo.scripter.co/doc/tags-and-categories/#file-based-export + +# Tags +#+HUGO_TAGS: mega__front-matter +#+HUGO_TAGS: keys +#+HUGO_TAGS: collection concatenation merging + +# Categories +#+HUGO_CATEGORIES: cat1 +#+HUGO_CATEGORIES: cat2 + +# Menu +#+HUGO_MENU: :menu foo +#+HUGO_MENU: :weight 10 + +# # Menu Override +# #+HUGO_MENU_OVERRIDE: :menu bar +# #+HUGO_MENU_OVERRIDE: :weight 20 + +# Custom front-matter +#+HUGO_CUSTOM_FRONT_MATTER: :foo bar +#+HUGO_CUSTOM_FRONT_MATTER: :baz zoo +#+HUGO_CUSTOM_FRONT_MATTER: :alpha 1 +#+HUGO_CUSTOM_FRONT_MATTER: :beta "two words" +#+HUGO_CUSTOM_FRONT_MATTER: :gamma 10 +#+HUGO_CUSTOM_FRONT_MATTER: :animals '(dog cat "penguin" "mountain gorilla") +#+HUGO_CUSTOM_FRONT_MATTER: :strings-symbols '("abc" def "two words") +#+HUGO_CUSTOM_FRONT_MATTER: :integers '(123 -5 17 1_234) +#+HUGO_CUSTOM_FRONT_MATTER: :floats '(12.3 -5.0 -17E-6) +#+HUGO_CUSTOM_FRONT_MATTER: :booleans '(true false) + +# Blackfriday +#+HUGO_BLACKFRIDAY: :smartdashes :fractions nil :plainidanchors false +#+HUGO_BLACKFRIDAY: :angledquotes t :hrefTargetBlank true +#+HUGO_BLACKFRIDAY: :extensions tabsizeeight hardlinebreak +#+HUGO_BLACKFRIDAY: :extensionsmask fencedcode strikethrough + +# Front-matter key replacement +#+HUGO_FRONT_MATTER_KEY_REPLACE: foo>myfoo +#+HUGO_FRONT_MATTER_KEY_REPLACE: baz>mybaz + +# Aliases +#+HUGO_ALIASES: keyword-concatenation +#+HUGO_ALIASES: keyword-merging + +# Keywords +#+KEYWORDS: keyword1 keyword2 +#+KEYWORDS: three__word__keywords3 + +# Outputs +#+HUGO_OUTPUTS: html +#+HUGO_OUTPUTS: json + +# Resources +#+HUGO_RESOURCES: :src "*.png" :animals '(dog cat "penguin" "mountain gorilla") +#+HUGO_RESOURCES: :strings-symbols '("abc" def "two words") +#+HUGO_RESOURCES: :integers '(123 -5 17 1_234) +#+HUGO_RESOURCES: :floats '(12.3 -5.0 -17E-6) +#+HUGO_RESOURCES: :booleans '(true false) +#+HUGO_RESOURCES: :foo bar +#+HUGO_RESOURCES: :src "image-4.png" :title "The Fourth Image" +#+HUGO_RESOURCES: :src "*.png" :name "my-cool-image-:counter" :title "The Image #:counter" +#+HUGO_RESOURCES: :src "*.png" :byline "bep" +#+HUGO_RESOURCES: :src "*.jpg" :title "JPEG Image #:counter" + +This is a test post that tests that keywords set across multiple Org +keywords get collected. + +* Keyword Collection Tested to work [12/12] +- [X] =#+AUTHOR= +- [X] =#+HUGO_TAGS= +- [X] =#+HUGO_CATEGORIES= +- [X] =#+HUGO_MENU= +- [X] =#+HUGO_MENU_OVERRIDE= +- [X] =#+HUGO_CUSTOM_FRONT_MATTER= +- [X] =#+HUGO_BLACKFRIDAY= +- [X] =#+HUGO_FRONT_MATTER_KEY_REPLACE= +- [X] =#+HUGO_ALIASES= +- [X] =#+KEYWORDS= +- [X] =#+HUGO_OUTPUTS= +- [X] =#+HUGO_RESOURCES= diff --git a/test/site/content/posts/keyword-collection.md b/test/site/content/posts/keyword-collection.md new file mode 100644 index 0000000..bc7719f --- /dev/null +++ b/test/site/content/posts/keyword-collection.md @@ -0,0 +1,68 @@ ++++ +title = "Keyword Collection" +author = ["firstname1 lastname1", "firstname2 lastname2", "firstname3 lastname3"] +aliases = ["/posts/keyword-concatenation", "/posts/keyword-merging"] +keywords = ["keyword1", "keyword2", "three word keywords3"] +outputs = ["html", "json"] +tags = ["mega front-matter", "keys", "collection", "concatenation", "merging"] +categories = ["cat1", "cat2"] +draft = false +myfoo = "bar" +mybaz = "zoo" +alpha = 1 +beta = "two words" +gamma = 10 +animals = ["dog", "cat", "penguin", "mountain gorilla"] +strings-symbols = ["abc", "def", "two words"] +integers = [123, -5, 17, 1_234] +floats = [12.3, -5.0, -1.7e-05] +booleans = [true, false] +[blackfriday] + extensionsmask = ["fencedCode", "strikethrough"] + extensions = ["tabSizeEight", "hardLineBreak"] + plainIDAnchors = false + hrefTargetBlank = true + smartDashes = false + fractions = false + angledQuotes = true +[menu.foo] + identifier = "keyword-collection" + weight = 10 +[[resources]] + src = "*.png" + name = "my-cool-image-:counter" + title = "The Image #:counter" + [resources.params] + foo = "bar" + floats = [12.3, -5.0, -1.7e-05] + strings-symbols = ["abc", "def", "two words"] + animals = ["dog", "cat", "penguin", "mountain gorilla"] + integers = [123, -5, 17, 1_234] + booleans = [true, false] + byline = "bep" +[[resources]] + src = "image-4.png" + title = "The Fourth Image" +[[resources]] + src = "*.jpg" + title = "JPEG Image #:counter" ++++ + +This is a test post that tests that keywords set across multiple Org +keywords get collected. + + +## Keyword Collection Tested to work [12/12] {#keyword-collection-tested-to-work} + +- [X] `#+AUTHOR` +- [X] `#+HUGO_TAGS` +- [X] `#+HUGO_CATEGORIES` +- [X] `#+HUGO_MENU` +- [X] `#+HUGO_MENU_OVERRIDE` +- [X] `#+HUGO_CUSTOM_FRONT_MATTER` +- [X] `#+HUGO_BLACKFRIDAY` +- [X] `#+HUGO_FRONT_MATTER_KEY_REPLACE` +- [X] `#+HUGO_ALIASES` +- [X] `#+KEYWORDS` +- [X] `#+HUGO_OUTPUTS` +- [X] `#+HUGO_RESOURCES`