Skip to content

Commit 9a1a74f

Browse files
committed
Set noindex on package search and compare pages
1 parent 8096881 commit 9a1a74f

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

internal/ui/compare/handler.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package compare
22

33
import (
44
"net/http"
5-
"net/url"
65
"strings"
76

87
"pkgstatsd/internal/chartdata"
@@ -57,13 +56,8 @@ func (h *Handler) HandleCompare(w http.ResponseWriter, r *http.Request) {
5756

5857
data := chartdata.Build(allSeries)
5958

60-
escapedNames := make([]string, len(names))
61-
for i, n := range names {
62-
escapedNames[i] = url.PathEscape(n)
63-
}
64-
6559
layout.Render(w, r,
66-
layout.Page{Title: "Compare packages", Description: "Compare the popularity of Arch Linux packages side by side.", Path: "/packages", Manifest: h.manifest, CanonicalPath: "/compare/packages/" + strings.Join(escapedNames, ",")},
60+
layout.Page{Title: "Compare packages", Description: "Compare the popularity of Arch Linux packages side by side.", Path: "/packages", Manifest: h.manifest, NoIndex: true},
6761
CompareContent(names, excessNames, data),
6862
)
6963
}

internal/ui/packagelist/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (h *Handler) HandlePackages(w http.ResponseWriter, r *http.Request) {
5656
}
5757

5858
layout.Render(w, r,
59-
layout.Page{Title: "Package statistics", Description: "Search and compare Arch Linux package popularity based on pkgstats submissions.", Path: "/packages", Manifest: h.manifest},
59+
layout.Page{Title: "Package statistics", Description: "Search and compare Arch Linux package popularity based on pkgstats submissions.", Path: "/packages", Manifest: h.manifest, NoIndex: query != "" || compare != ""},
6060
PackagesContent(list, query, offset, limit, compare, selectedPackages),
6161
)
6262
}

0 commit comments

Comments
 (0)