feat: public API, SEO and existing surfaces
This commit is contained in:
1 parent
45fbbc33b1
commit
c390fcfe8d
103 files changed
+4476
-231
No files matched your search
@@ -42,8 +42,8 @@ func TestSeoOutputSitemap(t *testing.T) {
|
||||
e.articles.articles[20] = article.Article{ID: 20, Title: "Twenty", IsOnline: true, SiteID: seoOutJournalID, Slug: "twenty", CreatedAt: seoOutCreated, UpdatedAt: seoOutModified}
|
||||
rec, items := e.sitemap(t, "", "")
|
||||
want := []map[string]any{
|
||||
{"url": seoOutBase + "/" + seoOutArticleSlug, "modified_at": "2026-09-10T09:30:00Z", "noindex": false},
|
||||
{"url": seoOutBase + "/sixteen", "modified_at": "2026-09-10T09:30:00Z", "noindex": false},
|
||||
{"url": seoOutBase + "/" + seoOutArticleSlug, "modified_at": "2026-09-10T09:30:00Z", "noindex": false, "lang": ""},
|
||||
{"url": seoOutBase + "/sixteen", "modified_at": "2026-09-10T09:30:00Z", "noindex": false, "lang": ""},
|
||||
}
|
||||
if rec.Code != http.StatusOK || !reflect.DeepEqual(items, want) || rec.Header().Get("X-Total-Count") != "2" {
|
||||
t.Errorf("status %d total %q items %v", rec.Code, rec.Header().Get("X-Total-Count"), items)
|
||||
@@ -97,7 +97,7 @@ func TestSeoOutputSitemap(t *testing.T) {
|
||||
t.Run("Each item has exactly the documented keys", func(t *testing.T) {
|
||||
e := newSeoOutEnv(t)
|
||||
_, items := e.sitemap(t, "", "")
|
||||
if sortedKeys(items[0]) != "modified_at,noindex,url" {
|
||||
if sortedKeys(items[0]) != "lang,modified_at,noindex,url" {
|
||||
t.Errorf("keys = %s", sortedKeys(items[0]))
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user