Closed ThuF closed 2 years ago
The nav
config in .pages
files doesn't support creating new sections. There are two ways to achieve what you want:
nav
config in mkdocs.yml
. It allows you to create sections which are not present in the file structure (README)That said, let me know if you'd find such a feature useful and I'll see what I can do.
Hi @lukasgeiter,
Thank you for the fast reply!
Yes, I think such feature request will make the plugin much more flexible!
I have the following use case - I am trying to update the look & feel of the Blogs section of Eclipse Dirigible with MkDocs (Material for MkDocs) and part of the task is how to organise the blogs. My initial attempt was to separate each blog post into separate year folder - 2020
, 2019
, 2018
etc. That way the default grouping is okay, but I need to change the ordering - 2020
to come first, instead of 2014
for example - order: desc
. Also I want to introduce such ordering for the items (blogs) in each group (year), so that the latest blog will come first.
The existing naming convention that is as following -
2014-03-21-blogs_start_of_journey.md
, but it can be changed to03-21-blogs_start_of_journey.md
for example.
Regards, Yordan
I'll see what I can do...
In the meantime, you should be able to do the following with the current version:
.pages
file with order: desc
in each folder as well as on the top-levelI think this is actually a cleaner solution as it doesn't need regex and doesn't require you to manually list each year in nav
.
@lukasgeiter any advice on how/where to implement this?
Would this be checking for type list here and then returning a nested list?
Hi @lukasgeiter, this is something that would be pretty useful for me too. I have some docs autogenerated with openapi-codegen
where the endpoints and models are all inside the same folder but it would be pretty useful to have them as sections in the nav
. Moving the files into subfolders is not feasible since they contain cross links in the markdown that would need to be replaced, which is ugly and error prone.
So something like this would be pretty awesome:
nav:
- Endpoints:
- ... | *Api.md
- Models:
- ...
This is now possible in version 2.7.0
I'm experiencing a
TypeError
error with the following configuration:.pages:
However the following configuration is working:
Error:
Also I'm building a custom Docker image for Material for MkDocs, to include the awesome-pages-plugin: - https://squidfunk.github.io/mkdocs-material/getting-started/ -
How to add plugins to the Docker image?