hugo/hugolib/sitemap.go
2014-05-09 23:11:27 -04:00

19 lines
419 B
Go

package hugolib
import jww "github.com/spf13/jwalterweatherman"
type Sitemap struct {
ChangeFreq string
Priority float32
}
func (s Sitemap) Validate() {
if s.Priority < 0 {
jww.WARN.Printf("Sitemap priority should be greater than 0, found: %f", s.Priority)
s.Priority = 0
} else if s.Priority > 1 {
jww.WARN.Printf("Sitemap priority should be lesser than 1, found: %f", s.Priority)
s.Priority = 1
}
}