Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back redirect #7790

Closed
4 tasks done
ZhiyuanChen opened this issue Dec 13, 2024 · 1 comment
Closed
4 tasks done

Bring back redirect #7790

ZhiyuanChen opened this issue Dec 13, 2024 · 1 comment
Labels
resolved Issue is resolved, yet unreleased if open upstream Issue must be taken upstream

Comments

@ZhiyuanChen
Copy link

Context

The Redirect feature allows a page to be redirected to another page.
This feature is deprecated in MkDocs 5.5, and removed in MkDocs 6.0, in favour of mkdocs-redirect package.

Description

The mkdocs-redirect package has a long standing problem of compatibility with other plugins, like i18n (suffix and folder), use_directory_urls, etc.

This makes it practically useless.

It is therefore important to keep the redirect option until it works with the rest of the MkDocs environment.

Related links

Use Cases

Redirect can be useful when pages are moved, and when using README as index page where they have different locations in repo and on web.

Visuals

No response

Before submitting

@squidfunk
Copy link
Owner

squidfunk commented Dec 13, 2024

Thanks for suggesting. I'm not sure what you exactly mean about the redirect feature, but you're probably referring to the redirect front matter property that once existed. You can use the redirect.html template, which is undocumented because it is not part of our public API, but it's not expected to be removed anytime soon. In any Markdown file, just set:

---
template: redirect.html
location: https://example.com
---

The bugs should be fixed in mkdocs-redirects, which is the canonical plugin to provide redirects, since those are a theme-agnostic feature. Thus, we consider this as an upstream issue, but you can use the workaround in the meantime.

@squidfunk squidfunk closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2024
@squidfunk squidfunk added resolved Issue is resolved, yet unreleased if open upstream Issue must be taken upstream labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved Issue is resolved, yet unreleased if open upstream Issue must be taken upstream
Projects
None yet
Development

No branches or pull requests

2 participants