mkdocs_nype.plugins.server_redirects.plugin
Synopsis
MkDocs plugin made to generate file with back-end redirects
The best way to handle a redirection is to respond with a 301 status code and point the traffic to that location, instead of loading a 200 / 404 status code page with a meta-refresh / JavaScript redirect.
This plugin generates an Nginx compliant redirects mapping, which is then loaded after deployment.
MIT License 2024 Kamil Krzyśków (HRY) for Nype (npe.cm)
LOG
Logger instance for this plugin.
ServerRedirectsPlugin
Bases: BasePlugin[ServerRedirectsConfig]
on_env
Create the server redirects here, to allow other plugins to inject them before on_env
convert_filepath_to_url
Mainly used for the old non-existent file, as we take the file.url for existing files