Closed ziadbkh closed 1 year ago
hi @ziadbkh I think this is already possible. @bedroesb, please let me know if the below isn't correct 😄 The config file and pages directory for the [ELIXIR toolkit theme example)(https://elixir-belgium.github.io/elixir-toolkit-theme/):
pages
directorypages
directory within the config.yml
filemain.yml
sidebar file without referring to the directory structure, andas long as this matches to our implementation of the theme, then it should work?
what about if we remove the pages/directory
bit for each of the pages in the main.yml
? here: https://github.com/AustralianBioCommons/tower/blob/main/_data/sidebars/main.yml
@supernord Correct, this is possible. The most robust way is to serve the subfolders in the root of the project instead of the pages directory. This will also create the most robust urls (who work with and without trailing backslash).
An example website where this is in use is https://www.infectious-diseases-toolkit.org/ with in its config file:
permalink: /:categories/:year/:month/:day/:title
with having index files in the main sections of the website: https://github.com/elixir-europe/infectious-diseases-toolkit/tree/main/socioeconomic-data.
The only thing I want to make aware of is the following:
relative_url
function so having these more verbose urls are not a problem./page
root does not work, and page
will as link will not work from a subdirectory because it will try to access subdirectory/page
). This means you need to add relative_url
all the paths. With images it can be prevented by using the {% include image.html %} snippet, but with links it will be sucky...
Maybe it is useful to have subdirectories under pages directories and then the user can redirect to these pages as base_url/subdirectory/page_name. It does not work like this now, but it works with the full link base_url/pages/subdirectory/page_name