1
0
mirror of https://git.sr.ht/~adnano/kiln synced 2024-12-04 23:18:14 +01:00

dir: Add Params method

This commit is contained in:
adnano 2021-05-20 15:59:10 -04:00
parent 5592026db7
commit 62d414af39

6
dir.go

@ -33,7 +33,7 @@ type Page struct {
Path string `yaml:"-"` Path string `yaml:"-"`
FilePath string `yaml:"-"` FilePath string `yaml:"-"`
Content string `yaml:"-"` Content string `yaml:"-"`
Params map[string]string Params map[string]interface{}
Prev *Page `yaml:"-"` Prev *Page `yaml:"-"`
Next *Page `yaml:"-"` Next *Page `yaml:"-"`
} }
@ -315,6 +315,10 @@ func (d *Dir) Content() string {
return d.index.Content return d.index.Content
} }
func (d *Dir) Params() map[string]interface{} {
return d.index.Params
}
func (d *Dir) getDir(path string) *Dir { func (d *Dir) getDir(path string) *Dir {
// XXX: This is inefficient // XXX: This is inefficient
if d.Path == path { if d.Path == path {