Commit bb857df
authored
Add cases indexing controls and Apostrophe sitemap/robots setup (#270)
## Summary
- Add SEO indexing controls for `/cases` listing pages to prevent
indexing of filter/search/pagination URL combinations.
- Keep clean case detail URLs indexable and canonicalized, while
query-param detail variants are noindex.
- Integrate `@apostrophecms/sitemap` and configure robots handling for
dev/prod behavior, including sitemap publication.
## What changed
- Enabled sitemap module in `website/app.js`.
- Added sitemap config in
`website/modules/@apostrophecms/sitemap/index.js`.
- Added cases listing SEO logic (`index/noindex` + canonical) in:
- `website/modules/case-studies-page/index.js`
- `website/modules/case-studies-page/views/index.html`
- Added detail page canonical/robots behavior for query-param variants
in:
- `website/modules/case-studies-page/views/show.html`
- Added dynamic `robots.txt` route in `website/modules/robots/index.js`:
- Dev/non-prod: `Disallow: /`
- Prod: allow crawl, block `/cases` query combinations, publish sitemap
URL from `baseUrl`
- Installed compatible sitemap package version in
`website/package.json`:
- `@apostrophecms/sitemap@^1.2.0`
## Why
- Prevent crawler/index bloat caused by massive filter/search URL
combinations on case listings.
- Preserve SEO value on canonical case detail pages.
- Provide a clean, machine-readable sitemap for search engines and AI
crawlers.
## Validation
- Verified `http://localhost:3000/sitemap.xml` returns sitemap entries
for public pages and case detail pages.
- Verified `robots.txt` behavior in local/dev mode returns `Disallow:
/`.
- Verified listing/detail pages output expected canonical and robots
tags for clean vs query-param URLs.
## Notes
- Production correctness depends on `baseUrl` being set to
`https://www.speedandfunction.com`.
- Dev environment remains non-indexable by design.1 parent 2d19c8f commit bb857df
9 files changed
Lines changed: 103 additions & 1 deletion
File tree
- website
- modules
- @apostrophecms/sitemap
- case-studies-page
- services
- views
- robots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
168 | 198 | | |
169 | 199 | | |
170 | 200 | | |
| |||
219 | 249 | | |
220 | 250 | | |
221 | 251 | | |
| 252 | + | |
222 | 253 | | |
223 | 254 | | |
224 | 255 | | |
| |||
244 | 275 | | |
245 | 276 | | |
246 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
247 | 281 | | |
248 | 282 | | |
249 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
2 | 11 | | |
3 | 12 | | |
4 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
0 commit comments