I am looking for some pointers on creating my site that has a specific URL structure.
So there is a first selector which is the version and the second selector is the language as you can see in the URL.
I read that you can do this or something similar with collections and was somewhat successful rendering pages.
The folder structure is something like this
Each of those folders contains the markdown files that are contents of the site. Also in each folder there is a file called
sidebar.json that contains the sidebar metadata (for me to loop through and display it). When the version or language changes through navigation, the respective json file will be read, since we are now in a different folder so to speak.
Here is question #1. If I add the
sidebar.json file in the _data folder I can read it very easily. However I need the file to be in the language subfolder. I can loop using the site.files and locate the file but do not know how to read it so that it becomes something that I can work with or loop through. Any ideas on how to do that?
Second question: Is there a way to instruct Jekyll to redirect immediately when the user loads up the root folder or the version folder? Specifically
I go to
/ it redirects me or shows
I go to
/0.10/ it redirects me or shows
I read that there is a popular redirect plugin where one adds
redirect_from to the page you want to be redirected to but so far this has not worked at all
--- layout: default redirect_from: - / - /0.10/ ---
Any pointers are more than welcome