mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-30 07:30:13 +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
|
@ -131,6 +131,8 @@ func TestUnmarshalToInterface(t *testing.T) {
|
|||
{[]byte("#+a: foo bar\n#+a: baz"), ORG, map[string]any{"a": []string{string("foo bar"), string("baz")}}},
|
||||
{[]byte(`#+DATE: <2020-06-26 Fri>`), ORG, map[string]any{"date": "2020-06-26"}},
|
||||
{[]byte(`#+LASTMOD: <2020-06-26 Fri>`), ORG, map[string]any{"lastmod": "2020-06-26"}},
|
||||
{[]byte(`#+FILETAGS: :work:`), ORG, map[string]any{"filetags": []string{"work"}}},
|
||||
{[]byte(`#+FILETAGS: :work:fun:`), ORG, map[string]any{"filetags": []string{"work", "fun"}}},
|
||||
{[]byte(`#+PUBLISHDATE: <2020-06-26 Fri>`), ORG, map[string]any{"publishdate": "2020-06-26"}},
|
||||
{[]byte(`#+EXPIRYDATE: <2020-06-26 Fri>`), ORG, map[string]any{"expirydate": "2020-06-26"}},
|
||||
{[]byte(`a = "b"`), TOML, expect},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue