Add Sitemaps config values handling

This commit is contained in:
Vincent Batoufflet
2014-05-06 17:02:56 +02:00
committed by spf13
parent f8e675d064
commit 2a902bbca6
5 changed files with 49 additions and 13 deletions

View File

@@ -141,7 +141,7 @@ func renderBytes(content []byte, pagefmt string) []byte {
func newPage(filename string) *Page {
page := Page{contentType: "",
File: File{FileName: filename, Extension: "html"},
Node: Node{Keywords: []string{}},
Node: Node{Keywords: []string{}, Sitemap: Sitemap{Priority: -1}},
Params: make(map[string]interface{})}
jww.DEBUG.Println("Reading from", page.File.FileName)
@@ -342,6 +342,8 @@ func (page *Page) update(f interface{}) error {
}
case "status":
page.Status = cast.ToString(v)
case "sitemap":
page.Sitemap = parseSitemap(cast.ToStringMap(v))
default:
// If not one of the explicit values, store in Params
switch vv := v.(type) {