Commit d64aa6c
authored
SEO cleanup: sitemap, 404 metadata, coming-soon heading (#133)
* SEO cleanup: sitemap, 404 metadata, coming-soon heading
Three small fixes found while validating the live site.
Sitemap advertised /_not-found/. collectPages() emits a URL for any
directory holding an index.html and filters only top-level names in an
explicit deny-list. With trailingSlash the export writes
out/_not-found/index.html, and _not-found was not in the list. #123
fixed exactly this class for 404 but only added that one name. The page
also serves noindex, so the sitemap was submitting a URL that tells
crawlers not to index it. Added _not-found to the exclusion set.
404 page emitted two conflicting robots tags. not-found.tsx exported no
metadata, so it inherited the root layout's, which hardcodes
index/follow in metadataService - and Next.js separately injects noindex
for the not-found route. It also carried the homepage title byte for
byte. Added a metadata export with a distinct title and index: false.
/docs/architecture had no heading element at all - not just no h1, zero
h1-h6. The coming-soon layout renders the graphic plus placeholder prose,
and the markdown carries no heading, while the sidebar section label is
deliberately a <p> because "the article's h1 comes from the markdown
content". That contract is unmet for coming-soon pages, so the h1 now
comes from the frontmatter title, guarded in case a future coming-soon
page does start with a markdown heading.
The docs index also showed the Architecture card with no marker, styled
identically to the six finished ones. Marked it the same way the
Kubernetes Operator card marks preview status, via a title suffix.
Fixes #129
* Filter the sitemap on noindex rather than on directory name
The exclusion list was growing one framework route at a time. #123
added 404 after it appeared in the sitemap; this branch added _not-found
for the same reason; and the versioned-docs work in progress adds a
third hand-written skip for the archived version directories. Each is
the same rule discovered again: do not advertise a page that tells
crawlers not to index it.
That property is readable from the page itself, so collectPages now
reads each index.html and skips the ones carrying a noindex robots meta.
The name list keeps only the directories that hold no pages at all -
_next, deb, rpm, images - where it is a traversal concern rather than an
indexing decision.
The tag is matched in either attribute order and tolerates content lists
such as "noindex,nofollow", since Next.js and hand-written metadata do
not agree on either. The final log line now reports how many pages were
skipped, so a filter that starts matching too much is visible in the
build output instead of silently shrinking the sitemap.
Verified against a synthetic export carrying an indexable root, /docs,
/docs/versions, /packages and /samples, plus three noindex pages written
in three different tag forms and an excluded _next directory: five URLs
emitted, three skipped, and out/404.html left alone as the file it is.
Note that the archived-version case is now covered by this rule, so the
docs/versions skip on the versioned-docs branch can go when it lands.1 parent c29cb76 commit d64aa6c
4 files changed
Lines changed: 68 additions & 15 deletions
File tree
- app
- docs/[section]/[[...slug]]
- articles
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
187 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
188 | 199 | | |
189 | 200 | | |
190 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
3 | 17 | | |
4 | 18 | | |
5 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
26 | | - | |
27 | 33 | | |
28 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
29 | 49 | | |
30 | 50 | | |
31 | 51 | | |
| |||
45 | 65 | | |
46 | 66 | | |
47 | 67 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
52 | 76 | | |
53 | 77 | | |
54 | 78 | | |
| |||
113 | 137 | | |
114 | 138 | | |
115 | 139 | | |
116 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
0 commit comments