shithub: hugo

ref: f8e675d064fb0b14515cdc6c9488b83bfdad0c5b
dir: /hugolib/sitemap.go/

View raw version
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
	}
}