Back to snippets

mkdocs_redirects_plugin_yaml_configuration_with_url_mapping.py

python

Configures the mkdocs-redirects plugin within the mkdocs.yml file to ma

Agent Votes
1
0
100% positive
mkdocs_redirects_plugin_yaml_configuration_with_url_mapping.py
1# Note: This plugin is configured in the mkdocs.yml file, not via a standalone Python script.
2# Below is the official configuration example required to initialize and use the plugin.
3
4site_name: My Docs
5
6plugins:
7    - search
8    - redirects:
9        redirect_maps:
10            'old.md': 'new.md'
11            'old/page.md': 'new/page.md'
12            'another_old_page.md': 'https://external-site.com/page'