Repository navigation
Theme: Add nginx redirects template based on Aliases - #95
Conversation
|
Thanks, I'll review this and then get it set up server-side to use the new file. |
2e21201 to
3fe5855
Compare
| title: Innovate without limits | ||
| linkTitle: Features | ||
| description: Powerful and open parametric design for everyone. | ||
| aliases: ["/features"] |
There was a problem hiding this comment.
This one doesn't work: the section is already called "features", so this results in a circular self-redirecting loop.
|
@marcuspollio I've added a commit that makes a few tweaks to your setup here: give it a look. |
|
@marcuspollio good to go? |
|
Hi @chennes I've pushed another update as well: this adds support for directly redirecting pages that have the So now, for 301.nginx contentLet me know if this is fully OK for you (including the path and filename of this file), then we can merge. |
|
@marcuspollio PR has a conflict |
Also add old homepage URLs, and resolve targets the way the menus do. Finally, check against the allowed character set to prevent any sort of injection.
17f8268 to
de81dd1
Compare
|
This now maps maps the non-trailing-slash form (e.g. We should also decide what do do about the Code of Conduct and Privacy pages -- they are marked as Draft, so they aren't built, and their aliases aren't generated. So we need to hide them from the listings, or switch them out of draft, or something. We should also catch the old FPN links and redirect them someplace neutral and at least somewhat useful. I've added a new commit that takes care of all of these, @marcuspollio please give it a look. I'm still a total newb at Hugo so I'm learning as I go... |
There was a problem hiding this comment.
Thanks! Look good and fairly complete now.
So I just checked:
- every internal page with a redirect to an external URL now gets listed in the map both with and without a trailing slash, which is what we want. For some reasons, I had no issues with any of the two on my side when entering the address manually (Firefox 158).
- the codeofconduct/CODE_OF_CONDUCT and privacy/PRIVACY_POLICY combos work as expected, that is properly listed in the redirects map without their html page being built.
We now have about 600 entries in the redirects map.
When approved, I can merge. Can it be tested already on the staging environment?
|
I have to make one server-side change once this is merged, then we can test it on staging. |
This adds a Hugo-generated server-side URLs redirects file at
/public/.nginx/301.nginx, as part of #89.The file structure is similar to (excerpt):
Basically, for each page with
Aliases, a map of paths is created with first the old URL and then the new one.Old URLs can be
/<old>,/<old>/,/<old>.php, or/<old>.php?lang=<locale>.New URLs are either the default English
/<new>/, or if the translation is enabled/<lang>/<new>/.Page with
Aliasesare currently: Code of Conduct, Privacy Policy, Calendar, Professional Network, Development Handbook, Donate, Download, Addons, Features, and News.For references, see Hugo URL management and Aliases documentation.
For references, I used a
wgetof the current "old" FreeCAD website pages:Log after cleanup
PR checklist