The syntax for specifying nested map values custom front-matter is:
Using property drawer (in subtrees):
:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :PARENT_KEY{} '((KEY1 . VAL1) (KEY2 . VAL2) (KEY3 . VAL3) ..)
Using keyword:
#+hugo_custom_front_matter: :PARENT_KEY{} '((KEY1 . VAL1) (KEY2 . VAL2) (KEY3 . VAL3) ..)
The "{}" at the end of the key name is what tells ox-hugo that this is
a nested map.
Only 1 level of nested keys is supported.
Fixes https://github.com/kaushalmodi/ox-hugo/issues/139.
master
parent
aba67e10bf
commit
d0a60c5104
6 changed files with 149 additions and 1 deletions
@ -0,0 +1,23 @@ |
||||
+++ |
||||
title = "Custom front matter with nested maps in TOML" |
||||
description = "Custom TOML front-matter with TOML tables." |
||||
tags = ["custom-fm", "TOML-Table", "nested-map"] |
||||
draft = false |
||||
[dog] |
||||
legs = 4 |
||||
eyes = 2 |
||||
friends = ["poo", "boo"] |
||||
[header] |
||||
image = "projects/Readingabook.jpg" |
||||
caption = "stay hungry, stay foolish" |
||||
[collection] |
||||
nothing = false |
||||
nonnil = true |
||||
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] |
||||
+++ |
||||
|
||||
`ox-hugo` Issue #[139](https://github.com/kaushalmodi/ox-hugo/issues/139) |
||||
@ -0,0 +1,23 @@ |
||||
--- |
||||
title: "Custom front matter with nested maps in YAML" |
||||
description: "Custom YAML front-matter with nested maps." |
||||
tags: ["custom-fm", "TOML-Table", "nested-map"] |
||||
draft: false |
||||
dog: |
||||
legs: 4 |
||||
eyes: 2 |
||||
friends: ["poo", "boo"] |
||||
header: |
||||
image: "projects/Readingabook.jpg" |
||||
caption: "stay hungry, stay foolish" |
||||
collection: |
||||
nothing: false |
||||
nonnil: true |
||||
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] |
||||
--- |
||||
|
||||
`ox-hugo` Issue #[139](https://github.com/kaushalmodi/ox-hugo/issues/139) |
||||
Loading…
Reference in new issue