repo: https://github.com/mistermantas/edu.mnts.lt
here’s my question: what hecking template do I need to use to show all the pages under these directories:
- edu.mnts.lt/docs/geografija/
- edu.mnts.lt/docs/literatura/
- edu.mnts.lt/docs/english/
I can’t figure it out: any template I try, I see a blank page on localhost. It’s INFURIATING
like, edu.mnts.lt/docs lists all the pages in the directory (which is what I want for ALL the subdirectories under docs) because of the layouts/docs/list.html
file
but i want to keep the categorization via folders here (they’re by subject) and also add tags (like for classes, A level, 11th grade, etc) but that’s slightly off topic
I’m not quite sure I understand what output you want where.
Do you want pages under those directories printed out when you load /docs/
? Do you want only pages from those subdirectories? I see you have three other directories under content/docs/
, Do you also want those printed out? Or just these three?
Or do you want for example docs/english/
to list the pages under it?
What have you actually tried? As in, what lines of code did you put in which template, and what did that do?
Or do you want for example docs/english/
to list the pages under it?
Yes, I want automatically for all the subdirectories under docs
to list their pages. But I don’t know what template I need.
What have you actually tried? As in, what lines of code did you put in which template, and what did that do?
I don’t know WHAT TEMPLATE I need, that’s my problem
_default/baseof.html ain’t working
_default/list.html ain’t working
_default/single.html (I think) doesn’t work either
You need to read the docs on this page: https://gohugo.io/templates/lookup-order/ especially the section on Layout Lookup for Section Pages.
The reason layouts/_default/list.html
is not working is because you have layouts/docs/list.html
, which is the more specific layout.
No, I know about that, but how do I specify it for subdirectories? Is that even possible?
Also just to be clear: removing docs/list.html doesn’t help. Still a blank page…
Add _index.md
to your sub-sections.
I want to list the pages in the subsections, an index file isn’t going to help me if I can’t even use {{ }} tags there
Well, if you are not trying my suggestions, then maybe someone else can chime in here to help you. Good luck.
I have requirements for this thing (this thing being: listing pages in a subdirectory) that I want to do. If your solution doesn’t fit my requirements, it’s not a solution?