Move a section without breaking links
To rename blog/ to articles/:
-
Move the folder.
-
Add
articles/_defaults.jsxso every page answers at its old URL too:aliases = [page.path.replace(/^\/articles/, "/blog")]; -
Build.
/blog/2021/ngrokgets a redirect page to/articles/2021/ngrok,/blogredirects to/articles, and the old feed URL/blog/feed.xmlkeeps serving the feed itself, so subscribers don't notice. Old pages are gone from_public/because every build starts clean.
On a host that reads _redirects, you can add /blog/* /articles/:splat too,
for real 301s. See
Aliases and redirects
.