Coder Social home page Coder Social logo

Comments (8)

kamilkrzyskow avatar kamilkrzyskow commented on June 11, 2024 1

You could override the 404.html template with a version that contains a JavaScript redirection script based on the URL for old links.

from mkdocs-static-i18n.

MetalKnight56 avatar MetalKnight56 commented on June 11, 2024 1

You could override the 404.html template with a version that contains a JavaScript redirection script based on the URL for old links.

That's a good idea, I'll try it

from mkdocs-static-i18n.

kamilkrzyskow avatar kamilkrzyskow commented on June 11, 2024

Hello @MetalKnight56,
looking at https://readthedocs.org/projects/epicfight-docs/ it seems that ReadTheDocs itself sets /en/latest/ as the root / page of the project. I don't understand why it adds /en/ before the /latest/.

The i18n 1.0 plugin creates the default language at the / root directory and then creates subsequent languages at /lang_code/. Before in 0.53 it would also duplicate the default language in it's own /lang_code/ path.

It's hard to tell what's the issue here as the behaviour didn't change so much. You could try setting the site_url in your mkdocs.yml https://www.mkdocs.org/user-guide/configuration/#site_url to https://epicfight-docs.readthedocs.io/
Other than that investigate ReadTheDocs to find how it sets the / directory.

from mkdocs-static-i18n.

MetalKnight56 avatar MetalKnight56 commented on June 11, 2024

Hello @MetalKnight56, looking at readthedocs.org/projects/epicfight-docs it seems that ReadTheDocs itself sets /en/latest/ as the root / page of the project. I don't understand why it adds /en/ before the /latest/.

The i18n 1.0 plugin creates the default language at the / root directory and then creates subsequent languages at /lang_code/. Before in 0.53 it would also duplicate the default language in it's own /lang_code/ path.

It's hard to tell what's the issue here as the behaviour didn't change so much. You could try setting the site_url in your mkdocs.yml mkdocs.org/user-guide/configuration/#site_url to https://epicfight-docs.readthedocs.io/ Other than that investigate ReadTheDocs to find how it sets the / directory.

The thing that is weird is the fact that before when i used "0.56" version of i18n it all worked just fine, because it would add the lang code even after selecting any page including the index.en
so for example when you click on a language when on index.en it would look something like this the url
https://epicfight-docs.readthedocs.io/en/latest/pt/
but now it just does this - https://epicfight-docs.readthedocs.io/pt/

from mkdocs-static-i18n.

kamilkrzyskow avatar kamilkrzyskow commented on June 11, 2024

If you're saying that https://epicfight-docs.readthedocs.io/en/latest/pt/ is correct, then try setting the site_url to https://epicfight-docs.readthedocs.io/en/latest/, but to me it's weird that there is both en and pt.

from mkdocs-static-i18n.

MetalKnight56 avatar MetalKnight56 commented on June 11, 2024

If you're saying that https://epicfight-docs.readthedocs.io/en/latest/pt/ is correct, then try setting the site_url to https://epicfight-docs.readthedocs.io/en/latest/, but to me it's weird that there is both en and pt.

Ok i found the solution to it, but it just gave me a huge headache. So ReadTheDocs allows me to change how they build the versioning scheme. If anyone ever has the same issue as me, here's the reference - https://docs.readthedocs.io/en/latest/versioning-schemes.html#

Just gotta change a setting on the admin panel>adavanced options and change the versioning scheme to Single version

(Mind that it took me like 10 minutes or so for the changes to apply + it broke all links i had on my other pages...)

Here's the new page - https://epicfight-docs.readthedocs.io/

from mkdocs-static-i18n.

kamilkrzyskow avatar kamilkrzyskow commented on June 11, 2024

Did you try using site_url or not? I believe it would allow you to keep the old links working.

from mkdocs-static-i18n.

MetalKnight56 avatar MetalKnight56 commented on June 11, 2024

Did you try using site_url or not? I believe it would allow you to keep the old links working.

didn't actually try that, but i mean, just converted the links its fine, i agree with you that it did look weird so i kinda stopped stalling and got to fix that as well

from mkdocs-static-i18n.

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.