From 1e0b97b4d418baeb49aa8b0c58dfce265f4ef8b3 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Sun, 27 Jun 2021 20:59:11 +0200 Subject: [PATCH] Add generic day path to sitemap --- sitemap.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sitemap.go b/sitemap.go index a50564a..75f0180 100644 --- a/sitemap.go +++ b/sitemap.go @@ -58,7 +58,7 @@ func (a *goBlog) serveSitemap(w http.ResponseWriter, r *http.Request) { }) already[yearPath] = true } - // Specific month + // Month monthPath := yearPath + "/" + fmt.Sprintf("%02d", d.month) if !already[monthPath] { sm.Add(&sitemap.URL{ @@ -66,7 +66,7 @@ func (a *goBlog) serveSitemap(w http.ResponseWriter, r *http.Request) { }) already[monthPath] = true } - // Specific day + // Day dayPath := monthPath + "/" + fmt.Sprintf("%02d", d.day) if !already[dayPath] { sm.Add(&sitemap.URL{ @@ -74,7 +74,7 @@ func (a *goBlog) serveSitemap(w http.ResponseWriter, r *http.Request) { }) already[dayPath] = true } - // Generic month + // XXXX-MM genericMonthPath := bc.getRelativePath("/x/" + fmt.Sprintf("%02d", d.month)) if !already[genericMonthPath] { sm.Add(&sitemap.URL{ @@ -82,7 +82,7 @@ func (a *goBlog) serveSitemap(w http.ResponseWriter, r *http.Request) { }) already[genericMonthPath] = true } - // Specific day + // XXXX-MM-DD genericMonthDayPath := genericMonthPath + "/" + fmt.Sprintf("%02d", d.day) if !already[genericMonthDayPath] { sm.Add(&sitemap.URL{ @@ -90,6 +90,14 @@ func (a *goBlog) serveSitemap(w http.ResponseWriter, r *http.Request) { }) already[genericMonthDayPath] = true } + // XXXX-XX-DD + genericDayPath := bc.getRelativePath("/x/x/" + fmt.Sprintf("%02d", d.day)) + if !already[genericDayPath] { + sm.Add(&sitemap.URL{ + Loc: a.getFullAddress(genericDayPath), + }) + already[genericDayPath] = true + } } } // Photos