AustralianBioCommons / guide-template

GitHub repository template for new How-to Guide websites.
https://australianbiocommons.github.io/guide-template/
MIT License
1 stars 0 forks source link

Allowing categorisation of files under pages into sub-directories #3

Closed ziadbkh closed 1 year ago

ziadbkh commented 1 year ago

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

supernord commented 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/):

as 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

bedroesb commented 1 year ago

@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: