{"id":13472631,"url":"https://github.com/mkdocs/mkdocs-redirects","last_synced_at":"2025-05-14T22:09:35.195Z","repository":{"id":40287180,"uuid":"179268421","full_name":"mkdocs/mkdocs-redirects","owner":"mkdocs","description":"Open source plugin for Mkdocs page redirects","archived":false,"fork":false,"pushed_at":"2025-02-19T12:10:49.000Z","size":97,"stargazers_count":204,"open_issues_count":15,"forks_count":32,"subscribers_count":132,"default_branch":"master","last_synced_at":"2025-05-12T01:08:19.228Z","etag":null,"topics":["mkdocs","plugin"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkdocs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-03T10:38:39.000Z","updated_at":"2025-05-08T20:29:20.000Z","dependencies_parsed_at":"2023-02-01T00:45:39.327Z","dependency_job_id":"e17e8e04-7467-4e6a-b1bc-d63c74bce264","html_url":"https://github.com/mkdocs/mkdocs-redirects","commit_stats":{"total_commits":93,"total_committers":15,"mean_commits":6.2,"dds":0.5376344086021505,"last_synced_commit":"32ccfd0ce36bcd25df66a5c58a3e1a0916f2a767"},"previous_names":["datarobot/mkdocs-redirects"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdocs%2Fmkdocs-redirects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdocs%2Fmkdocs-redirects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdocs%2Fmkdocs-redirects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdocs%2Fmkdocs-redirects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkdocs","download_url":"https://codeload.github.com/mkdocs/mkdocs-redirects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253656410,"owners_count":21943081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mkdocs","plugin"],"created_at":"2024-07-31T16:00:56.456Z","updated_at":"2025-05-14T22:09:30.184Z","avatar_url":"https://github.com/mkdocs.png","language":"Python","readme":"# mkdocs-redirects\n\n**Plugin for [`mkdocs`](https://www.mkdocs.org/) to create page redirects (e.g. for moved/renamed pages)**\n\nInitially developed by [DataRobot](https://www.datarobot.com/).\n\n[![PyPI](https://img.shields.io/pypi/v/mkdocs-redirects)](https://pypi.org/project/mkdocs-redirects/)\n[![License](https://img.shields.io/github/license/mkdocs/mkdocs-redirects)](https://github.com/mkdocs/mkdocs-redirects/blob/master/LICENSE.md)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mkdocs/mkdocs-redirects/ci.yml.svg)](https://github.com/mkdocs/mkdocs-redirects/actions?query=event%3Apush+branch%3Amaster)\n\n## Installing\n\nInstall with pip:\n\n```bash\npip install mkdocs-redirects\n```\n\n## Using\n\nTo use this plugin, specify your desired redirects in the plugin's `redirect_maps` setting in your `mkdocs.yml`:\n\n```yaml\nplugins:\n  - redirects:\n      redirect_maps:\n        'old.md': 'new.md'\n        'old/file.md': 'new/file.md'\n        'some_file.md': 'http://external.url.com/foobar'\n```\n\n\u003e **Note**  \n\u003e Don't forget that specifying the `plugins` setting will override the defaults if you didn't already have it set! See [this page](https://www.mkdocs.org/user-guide/configuration/#plugins) for more information.\n\nThe redirects map should take the form of a key/value pair:\n\n- The key of each redirect is the original _markdown doc_ (relative to the `docs_dir` path).\n  - This plugin will handle the filename resolution during the `mkdocs build` process.\n    This should be set to what the original markdown doc's filename was (or what it _would be_ if it existed), not the final HTML file rendered by MkDocs\n- The value is the _redirect target_. This can take the following forms:\n  - Path of the _markdown doc_ you wish to be redirected to (relative to `docs_dir`)\n    - This plugin will handle the filename resolution during the `mkdocs build` process.\n      This should be set to what the markdown doc's filename is, not the final HTML file rendered by MkDocs\n  - External URL (e.g. `http://example.com`)\n\nDuring the `mkdocs build` process, this plugin will create `.html` files in `site_dir` for each of the \"old\" file that redirects to the \"new\" path.\nIt will produce a warning if any problems are encountered or of the redirect target doesn't actually exist (useful if you have `strict: true` set).\n\n### `use_directory_urls`\n\nIf you have `use_directory_urls: true` set (which is the default), this plugin will modify the redirect targets to the _directory_ URL, not the _actual_ `index.html` filename.\nHowever, it will create the `index.html` file for each target in the correct place so URL resolution works.\n\nFor example, a redirect map of `'old/dir/README.md': 'new/dir/README.md'` will result in an HTML file created at `$site_dir/old/dir/index.html` which redirects to `../../new/dir/`.\n\nAdditionally, a redirect map of `'old/dir/doc_name.md': 'new/dir/doc_name.md'` will result in `$site_dir/old/dir/doc_name/index.html` redirecting to `../../new/dir/doc_name/`.\n\nThis mimics the behavior of how MkDocs builds the site dir without this plugin.\n\n## Developing\n\nDev dependencies and tasks are managed with [Hatch](https://hatch.pypa.io/). Tasks run in their own environment, created on the fly if missing, in a separate directory tree.\n\nTo run all checks and fixes:\n\n```bash\nhatch run all\n```\n\nYou can learn about individual commands from the output, or by inspecting `scripts` in [pyproject.toml](pyproject.toml).\n\n## Releasing\n\nA release is published to PyPI through GitHub Actions whenever a new tag is pushed.\n\nSo, to create a release, run `.tools/release.sh x.y.z` (which bumps the version in `__init__.py`, checks the build, creates a commit and a tag `vx.y.z`, and pushes it to GitHub).\n\nThen fill out a GitHub release with release notes.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkdocs%2Fmkdocs-redirects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkdocs%2Fmkdocs-redirects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkdocs%2Fmkdocs-redirects/lists"}