Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/docs-versions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func render(name, body string, v Version) string {
fmt.Fprintf(&fm, "title: %s\n", strconv.Quote(title))
fmt.Fprintf(&fm, "docs_version: %s\ndocs_page: %s\n", strconv.Quote(v.Slug), strconv.Quote(name))
if !v.Latest {
fm.WriteString("robots: noindex\n")
fm.WriteString("robots: noindex\nsitemap:\n disable: true\n")
}
fm.WriteString("---\n\n")
return fm.String() + strings.TrimLeft(text, "\n")
Expand Down Expand Up @@ -241,7 +241,7 @@ func run(repo, siteDir string) error {
}
index := fmt.Sprintf("---\ntitle: %s\ndocs_version: %s\ndocs_status: %s\n", strconv.Quote("Eraser "+v.Label+" documentation"), strconv.Quote(v.Slug), strconv.Quote(v.Status))
if !v.Latest {
index += "robots: noindex\n"
index += "robots: noindex\nsitemap:\n disable: true\n"
}
if err := os.WriteFile(filepath.Join(dir, "_index.md"), []byte(index+"---\n"), 0o644); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion scripts/docs-versions/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestRender(t *testing.T) {
t.Errorf("heading kept or latest page hidden:\n%s", out)
}
out = render("commands", "no heading, see [x](architecture.md)", Version{Slug: "next"})
if !strings.Contains(out, `title: "commands"`) || !strings.Contains(out, "robots: noindex") || !strings.Contains(out, "/blob/main/") {
if !strings.Contains(out, `title: "commands"`) || !strings.Contains(out, "robots: noindex") || !strings.Contains(out, "disable: true") || !strings.Contains(out, "/blob/main/") {
t.Errorf("fallback title, noindex or main ref wrong:\n%s", out)
}
}
Expand Down
2 changes: 2 additions & 0 deletions site/content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: "Documentation"
description: "Eraser documentation for every release: the stable releases and the nightly build from main."
robots: "noindex, follow"
sitemap:
disable: true
---

This page sends you to the latest stable release. Other versions are listed
Expand Down
Loading