Add support for series

master
Jan-Lukas Else 2020-03-31 17:02:05 +02:00
parent d747ceddf3
commit 9027f6734b
2 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,7 @@ type Entry struct {
lastmod string
section string
tags []string
series []string
link string
slug string
replyLink string
@ -210,6 +211,9 @@ func computeExtraSettings(entry *Entry) error {
} else if strings.HasPrefix(text, "tags: ") {
// Tags
entry.tags = strings.Split(strings.TrimPrefix(text, "tags: "), ",")
} else if strings.HasPrefix(text, "series: ") {
// Series
entry.series = strings.Split(strings.TrimPrefix(text, "series: "), ",")
} else if strings.HasPrefix(text, "link: ") {
// Link
entry.link = strings.TrimPrefix(text, "link: ")

View File

@ -11,6 +11,7 @@ type HugoFrontMatter struct {
Published string `yaml:"date,omitempty"`
Updated string `yaml:"lastmod,omitempty"`
Tags []string `yaml:"tags,omitempty"`
Series []string `yaml:"series,omitempty"`
ExternalURL string `yaml:"externalURL,omitempty"`
IndieWeb HugoFrontMatterIndieWeb `yaml:"indieweb,omitempty"`
Syndicate []string `yaml:"syndicate,omitempty"`
@ -40,6 +41,7 @@ func writeFrontMatter(entry *Entry) (string, error) {
Published: entry.date,
Updated: entry.lastmod,
Tags: entry.tags,
Series: entry.series,
ExternalURL: entry.link,
IndieWeb: HugoFrontMatterIndieWeb{
Reply: HugoFrontMatterReply{