I took it upon myself to generate an extra tree of content to present some data which was a root sub-directory and three sub-directories below that. I add it and things seems to work, the pages showed, but then I noticed my “posts” page was blank. Remove this directory and posts come back. Remove some of the sub-directories and posts come back. Add directory, gone.
I noticed no paginator pages (if that is relevant, and it seems plausibly odd to me.)
I tried running the hugo server locally with --debug and nothing jumped out at me. Could something in my pages be busting some limit, or causing some error, such that paginators are not created? I’ve tried using a dev/debug theme to poke around, although nothing has jumped out at me, but I’m typically using “hugo-now-ui” (with some tweaks I’ve added … so thar might be dragons …)
Hugo Static Site Generator v0.73.0/extended darwin/amd64 BuildDate: unknown
I’m using hugo 'cos I’m teaching myself go, so any pointers on how to “get inside hugo” (while it is running) would be appreciated.
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
I’d like to learn about hugo, learn how to get inside it mentally and debug 'cos I really like knowing what I am building upon. Any pointers for how to trace code, how to look inside and build a mental model, would be appreciated.
The theme I am using is hugo-now-ui and I’ve made a couple of tweaks to it, in part 'cos the taxonomy wasn’t supported, but I don’t believe (I hope not) that is a factor here.
The culprit directory is NFIRS-5.0.
One other question - other than the main which is “posts” goes empty when NFIRS-5.0 is present in content - is this. I tried adding an index.md to the NFIRS-5.0 directory, and when I do I get no content below. I tried an _index.md and got things, but I got all posts listed below the content on that index page (when I really wanted my own index, and of the sub-items.) I finally added an overview.md which seemed to work, but seemed like a hack. Clearly I don’t understand _index.md nor index.md and would appreciate any pointers.
P.S. There might be some poorly named files in there under ./NFIRS-5.0/elements (e.g. containing % or ( or something.) I’ve tried to strip those out, but might’ve missed something. I renamed things to be element-1.md to remove this factor, but it didn’t help.
It didn’t pass the smell test. I never mix cases with file paths or URLs. Some operating systems are case sensitive, some are not. Some web servers are case-sensitive by default, others are not. This habit is not specific to my work with Hugo.
Yes. See above.
No. I’ll typically add warnf statements to templates to figure out what’s happening.
Yeah, makes sense. If I’d thought about it that way I might’ve done that. As I’ve been learning go and the linter is telling me to use capitals for acronyms ( e.g. https://talks.golang.org/2014/names.slide#5 .) I viewed hugo in the go context. I appreciate you coming at it with a different perspective, and getting me back on track.
Your reference to the thread on _index.md/index.md was as helpful as you knew it would be. I do want _index.md … a branch not a leaf … but (and maybe a theme issue?) it gives me my manually (ok code) generated index … followed by a set of blog posts, i.e. completely unrelated content. I tried my overview.md manual index to try to get my list presentation and no posts, but is that a nasty hack? Should I be looking at the where clause in lists.html or somewhere else?
And the where function (used in conjunction with range in list pages):
It helps me to think top-down. Example use case:
When I visit https://example.com/foo/bar, I expect to see a list of the content within the bar directory, and nothing else. Each list item should contain the title, date of publication, a featured image, and a summary.
Thanks Joe, and thank you for continuing to be very helpful - I’ll consume all those. I came at Hugo as a user and I did try read the documentation, but clearly I’ve not gotten the understanding I needed to thrive. I didn’t write the theme nor the where clause, but I can learn how to hack them. Time to dig in further.
Not sure if this is right, but reading what you referenced I used nested _index.md files and:
… which turns off the list entries below my (already constructed) list content in those _index.md pages. (I probably should’ve hand crafted a list layout for those entries, but since I’d done it already when generating the markdown I was cool with what I had.)
You mean the second copy … of single to list? It was intentional, albeit likely hacky. I wanted my _index.md files (that already contained formatted list content, generated by my code) NOT to have the default theme listing attached at the bottom of the page. Not pretty, but it got me branches. Sorry if that is Hugo’s idea of code smell.