Commit 971132e
committed
layouts: generate Netlify redirects from page aliases frontmatter
Update layouts/index.redirects to iterate all site pages and emit
server-side Netlify redirect lines for each alias declared in page
frontmatter. This allows content authors and localization teams to
manage redirects directly via the aliases field without editing the
central static/_redirects.base file.
Implementation details:
- Collects all RegularPages permalinks for conflict detection
- Resolves relative aliases using path.Dir of the page's RelPermalink
- Emits a warnf and skips any alias conflicting with a real page URL
- Localized aliases are fully supported; they appear in production
builds where all language segments are rendered1 parent 3e847e5 commit 971132e
1 file changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
14 | 36 | | |
15 | 37 | | |
16 | | - | |
17 | | - | |
| 38 | + | |
| 39 | + | |
0 commit comments