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