hugolib/site_render.go: Warn when missing layout files for content pages #3594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is very much a work-in-progress, debugging printfs and all. I thought discussing code would be easier done here than on the Discourse instance. That said…
One of the things I've noticed is that I'll screw something up and not be able to figure out what I did wrong. I'd like this patch to tell the user, in the output of
hugo serve -w
, that content exists for which there is no layout.Since the docs say
/tags/
and/categories/
aren't built by default anymore, I removed the line that adds them to the list of default taxonomies. That seems like the proper way.With the current debugging printfs enabled, I get reasonable warning messages like the following:
The "Found a layout for…" messages aren't useful except for me debugging this patch, but what do you think of the changes I've made to get the "No layout for…" messages in the user-visible output?