mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Allow renaming of sitemap.xml
This commit is contained in:
committed by
Steve Francia
parent
26d23f7f4b
commit
6cdb8109cf
@@ -21,10 +21,11 @@ import (
|
||||
type Sitemap struct {
|
||||
ChangeFreq string
|
||||
Priority float64
|
||||
Filename string
|
||||
}
|
||||
|
||||
func parseSitemap(input map[string]interface{}) Sitemap {
|
||||
sitemap := Sitemap{Priority: -1}
|
||||
sitemap := Sitemap{Priority: -1, Filename: "sitemap.xml"}
|
||||
|
||||
for key, value := range input {
|
||||
switch key {
|
||||
@@ -32,6 +33,8 @@ func parseSitemap(input map[string]interface{}) Sitemap {
|
||||
sitemap.ChangeFreq = cast.ToString(value)
|
||||
case "priority":
|
||||
sitemap.Priority = cast.ToFloat64(value)
|
||||
case "filename":
|
||||
sitemap.Filename = cast.ToString(value)
|
||||
default:
|
||||
jww.WARN.Printf("Unknown Sitemap field: %s\n", key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user