1
0
Fork 0
mirror of https://git.sr.ht/~adnano/kiln synced 2024-06-01 09:36:06 +02:00

dir: Add Params method

This commit is contained in:
Adnan Maolood 2021-05-20 15:59:10 -04:00
parent 3667c41c57
commit c632c0f01a

6
dir.go
View File

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