Im creating a documentation for a project of mine that I plan on hosting via github pages. I want to plan ahead and provide some sort of version selector. My current and probably very naive approach is that with a template im injecting a dropdown into the navbar that fetches a json file in which im listing all available versions that has its corresponding folder to which options in that dropdown redirect.
published-docs/ versions.json v1.0.0/ v1.1.0/ index.html (just redirects to hardcoded version)
published-docs/ versions.json v1.0.0/ v1.1.0/ index.html (just redirects to hardcoded version)
I bet there is some "proper" way to do it that automaticaly resolves url without version to the latest one, can preserve relative url when switching versions and so on, but I just dont know it and even dont know where to search for it. I would appreciate any kind of guidance where to start and later maybe some LLM will educate me on that further or something. Just note that im a web-stack noob , I write C# spaghetti in Unity for a living.