mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
@@ -18,6 +18,7 @@ import (
|
||||
"encoding/csv"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@@ -28,7 +29,6 @@ import (
|
||||
toml "github.com/pelletier/go-toml/v2"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cast"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
@@ -231,7 +231,7 @@ func parseORGDate(s string) string {
|
||||
|
||||
func (d Decoder) unmarshalORG(data []byte, v any) error {
|
||||
config := org.New()
|
||||
config.Log = jww.WARN
|
||||
config.Log = log.Default() // TODO(bep)
|
||||
document := config.Parse(bytes.NewReader(data), "")
|
||||
if document.Error != nil {
|
||||
return document.Error
|
||||
@@ -242,7 +242,7 @@ func (d Decoder) unmarshalORG(data []byte, v any) error {
|
||||
if strings.HasSuffix(k, "[]") {
|
||||
frontMatter[k[:len(k)-2]] = strings.Fields(v)
|
||||
} else if k == "tags" || k == "categories" || k == "aliases" {
|
||||
jww.WARN.Printf("Please use '#+%s[]:' notation, automatic conversion is deprecated.", k)
|
||||
log.Printf("warn: Please use '#+%s[]:' notation, automatic conversion is deprecated.", k)
|
||||
frontMatter[k] = strings.Fields(v)
|
||||
} else if k == "date" || k == "lastmod" || k == "publishdate" || k == "expirydate" {
|
||||
frontMatter[k] = parseORGDate(v)
|
||||
|
Reference in New Issue
Block a user