mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
parser: Handle org-mode filetags as slice
This adds support for filetags by slicing them according to [the org mode tag specification](https://orgmode.org/guide/Tags.html). Can be used to create taxonomies based on org-mode tags
This commit is contained in:
parent
22ee0918f3
commit
f02da7fbce
2 changed files with 6 additions and 0 deletions
|
@ -251,6 +251,10 @@ func (d Decoder) unmarshalORG(data []byte, v any) error {
|
|||
frontMatter[k[:len(k)-2]] = strings.Fields(v)
|
||||
} else if strings.Contains(v, "\n") {
|
||||
frontMatter[k] = strings.Split(v, "\n")
|
||||
} else if k == "filetags" {
|
||||
trimmed := strings.TrimPrefix(v, ":")
|
||||
trimmed = strings.TrimSuffix(trimmed, ":")
|
||||
frontMatter[k] = strings.Split(trimmed, ":")
|
||||
} else if k == "date" || k == "lastmod" || k == "publishdate" || k == "expirydate" {
|
||||
frontMatter[k] = parseORGDate(v)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue