mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02: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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user