New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate a per-directory index.html
#497
Comments
index.html
One alternative approach would be:
But perhaps it wouldn't be much easier than to implement it as described at the top. |
I am starting working on it, but going to a vacation so it will take a while. I have a strong temptation to refactor everything on the go, but it seems it would make merging a very long process, right? So I will stick to |
bump |
I was looking for some automated way to list pages, but not the way posts are listed (chronologically), but hierarchically: Each directory would have an index.html that would list the documents automatically.
I havent found a way to do it without changing the Java code, so I suggest to add this feature.
I imagine it this way:
JBake knows the documents and their metadata in each directory.
Let's add a template, e.g
directoryIndex.ftl
, and this would be called for each directory, with the model containing data of the items in that directory: documents, static files and subdirectories.This way, users could create a hierarchical set of pages: Documentations, catalogs, photo albums, taxonomies, ... without linking all of it manually and editing an index each time they add/remove/change some item.
Further, this template could include files from that directory, so it could add a per-directory header (or other page part).
Lastly, the data supplied to the template could be adjusted with a config file in that directory. For instance,
filter.documents.tags = tag1 && !tag2
could filter which documents would be in the model,filter.directories.name = !.* && !*.backup
could omit some dirs from the model.etc.
This could work well with what's described in (Config) Allow config overrides for sub-directories #490 Allow per-dir config overrides.
What do you think about this feature? Personally, for me this is probably the top-wanted.
Edit: Someone wanted the same in jbake-user group.
The text was updated successfully, but these errors were encountered: