Fix #2 (removing unaired LPs from Sitemap)
This commit is contained in:
parent
c392b53083
commit
b8e0e74f73
|
@ -40,17 +40,17 @@ func GenerateSitemap() {
|
|||
temp.ChangeFreq = "hourly"
|
||||
temp.Priority = 1.0
|
||||
uset.Url = append(uset.Url, temp)
|
||||
temp.Location = config.C.SiteUrl + "/lets-play"
|
||||
temp.Location = config.C.SiteUrl + "/lets-play/"
|
||||
temp.LastMod = time.Now()
|
||||
temp.ChangeFreq = "monthly"
|
||||
temp.Priority = 0.75
|
||||
uset.Url = append(uset.Url, temp)
|
||||
temp.Location = config.C.SiteUrl + "/testet"
|
||||
temp.Location = config.C.SiteUrl + "/testet/"
|
||||
temp.LastMod = time.Now()
|
||||
temp.ChangeFreq = "monthly"
|
||||
temp.Priority = 0.75
|
||||
uset.Url = append(uset.Url, temp)
|
||||
temp.Location = config.C.SiteUrl + "/zeige"
|
||||
temp.Location = config.C.SiteUrl + "/zeige/"
|
||||
temp.LastMod = time.Now()
|
||||
temp.ChangeFreq = "yearly"
|
||||
temp.Priority = 0.75
|
||||
|
@ -65,13 +65,15 @@ func genLPs(uset *urlset) {
|
|||
var LPs []database.LetsPlay
|
||||
database.Db.Where("aired IS NOT NULL").Find(&LPs)
|
||||
for _, LP := range LPs {
|
||||
if LP.Aired.IsZero() == false {
|
||||
var temp URL
|
||||
temp.Location = config.C.SiteUrl + "/lets-play/" + LP.Slug.String
|
||||
temp.Location = config.C.SiteUrl + "/lets-play/" + LP.Slug.String + "/"
|
||||
temp.LastMod = LP.Aired
|
||||
temp.ChangeFreq = "daily"
|
||||
temp.Priority = 0.5
|
||||
uset.Url = append(uset.Url, temp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func genLTs(uset *urlset) {
|
||||
|
@ -79,7 +81,7 @@ func genLTs(uset *urlset) {
|
|||
database.Db.Find(<s)
|
||||
for _, LT := range LTs {
|
||||
var temp URL
|
||||
temp.Location = config.C.SiteUrl + "/testet/" + LT.Slug.String
|
||||
temp.Location = config.C.SiteUrl + "/testet/" + LT.Slug.String + "/"
|
||||
temp.LastMod = LT.Aired
|
||||
temp.ChangeFreq = "never"
|
||||
temp.Priority = 0.5
|
||||
|
@ -91,13 +93,15 @@ func genEPs(uset *urlset) {
|
|||
var EPs []database.Episode
|
||||
database.Db.Find(&EPs)
|
||||
for _, EP := range EPs {
|
||||
if EP.Aired.IsZero() == false {
|
||||
var LP database.LetsPlay
|
||||
database.Db.Model(&EP).Related(&LP)
|
||||
var temp URL
|
||||
temp.Location = config.C.SiteUrl + "/lets-play/" + LP.Slug.String + "/" + EP.Slug.String
|
||||
temp.Location = config.C.SiteUrl + "/lets-play/" + LP.Slug.String + "/" + EP.Slug.String + "/"
|
||||
temp.LastMod = EP.Aired
|
||||
temp.ChangeFreq = "never"
|
||||
temp.Priority = 0.5
|
||||
uset.Url = append(uset.Url, temp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue