mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 01:13:08 +00:00
Expose path functions to permalinks
This commit is contained in:
parent
08443f1493
commit
318241b712
|
@ -50,7 +50,8 @@ func LoadConfig(path string) (*Config, error) {
|
||||||
// Parse permalinks
|
// Parse permalinks
|
||||||
c.permalinks = map[string]*template.Template{}
|
c.permalinks = map[string]*template.Template{}
|
||||||
for s := range c.Permalinks {
|
for s := range c.Permalinks {
|
||||||
t, err := template.New("permalink " + s).Parse(c.Permalinks[s])
|
t := template.New(fmt.Sprintf("permalink %q", s)).Funcs(funcs)
|
||||||
|
_, err := t.Parse(c.Permalinks[s])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ urls = []
|
||||||
|
|
||||||
# Site permalinks
|
# Site permalinks
|
||||||
[permalinks]
|
[permalinks]
|
||||||
"/" = '/{{.Date.Format "2006/01/02"}}{{.Path}}'
|
"/" = '/{{ .Date.Format "2006/01/02" }}/{{ path.Base .Path }}/'
|
||||||
|
|
||||||
# Site tasks
|
# Site tasks
|
||||||
[[tasks]]
|
[[tasks]]
|
||||||
|
|
Loading…
Reference in a new issue