Giter Club home page Giter Club logo

Comments (4)

Andre601 avatar Andre601 commented on June 14, 2024

Actually nevermind. There was a typo in my test and it now works. Sorry to bother.

from mkdocs-redirects.

DominikaK avatar DominikaK commented on June 14, 2024

While this has been reported as resolved, I am also encountering this issue at the moment, using mkdocs-redirects==1.0.4.

A redirect formulated as 'page_one.md': 'page_two.md#' correctly redirects from page_one.md to page_two.md.
However, the following configuration is ignored:

nav:
    - 'Documentation': 'index.md'
    - 'Page one': 'page_one.md'
    - 'Page two': 'page_two.md'

plugins:
    - redirects:
        redirect_maps:
            'page_one.md#heading': 'page_two.md#heading'

When running mkdocs serve, the following error message is displayed:

WARNING  -  redirects plugin: 'page_one.md#heading' is not a valid markdown file!
WARNING  -  Redirect target 'page_two.md#heading' does not exist!

from mkdocs-redirects.

Andre601 avatar Andre601 commented on June 14, 2024

While this has been reported as resolved, I am also encountering this issue at the moment, using mkdocs-redirects==1.0.4.

A redirect formulated as 'page_one.md': 'page_two.md#' correctly redirects from page_one.md to page_two.md. However, the following configuration is ignored:

nav:
    - 'Documentation': 'index.md'
    - 'Page one': 'page_one.md'
    - 'Page two': 'page_two.md'

plugins:
    - redirects:
        redirect_maps:
            'page_one.md#heading': 'page_two.md#heading'

When running mkdocs serve, the following error message is displayed:

WARNING  -  redirects plugin: 'page_one.md#heading' is not a valid markdown file!
WARNING  -  Redirect target 'page_two.md#heading' does not exist!

Don't add headers in the redirects. Just use the normal pages. Any redirects added to the URL will be forwarded to the redirect itself...
That's exactly what I mentioned in my issue.

So in your case 'page_one.md': 'page_two.md' would redirect page_one#some-header to page_two#some-header

from mkdocs-redirects.

DominikaK avatar DominikaK commented on June 14, 2024

Thanks for the advice. Do you know, then, if it's possible to create a redirect between two headings? Say, I changed heading "First heading" to "Second heading". 'page_one.md#first-heading': 'page_two.md#second-heading' will not function, but maybe you've found some other way to handle it?

from mkdocs-redirects.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.