When running bundle exec jekyll serve, the file http://127.0.0.1:4000/some-directory/some-file.html will be accessible. However, I want a list of files when accessing http://127.0.0.1:4000/some-directory.
One possibility is to create a file manually, containing a link to every file in that directory. But is there a possibility to auto-generate a page, or (even better), use some browser built-in (like when accessing file:///var/log)?
If you want to do that with a built site , I can recommend python built server. It gives you a folder overview in the browser if there is no index.html in the current folder.
cd _site
python3 -m http.server 4000
You can even run this from the project root to view your source files as folder. but anything not html such as markdown will be viewed as plain text or get prompted to download it to Downloads
so you just filter dynamically to pages which are in the same directory (or below) for the current page. This can be done once as a layout and reused
My plan is to use this to have a project with multiple nested levels but the index.md at each level uses a common layout and shows the table of contents for the directory
Yes, I know that. But if I access the pages in the directory using Liquid, I still have to create a file for each directory manually. My question is if there is an option to make Jekyll generate such an overview automatically, or enable the browser built-in directory view on GitHub pages.
directory browsing/listing as I have seen it is a function of the webserver - what you want in your 1st post is what I usually see happen when running jekyll serve - if you pull up a directory only (no index.html file) I usually see a list of files - but I have all my files output at index.html inside a folder with the title - so some-file.html would not exist - it would be some-file/index.html.
If in the browser I put /some-directory/ I would get a file list (haven’t done this in a long time so could be wrong now) as there would be no index file there and the built in webserver for jekyll I think does have enable directory listing turned on. But that is just locally. My understanding is that this is a really bad practice to have this enabled for public websites as it would show anything and everything which could show all kinds of files with secret keys and what not.
So if you want this locally, I think it is possible and may have to do with the permalink structure if it is not working for you.
If you want this on GH then I don’t think it is going to happen without you somehow creating it which I can’t see an easy way to do.