Currently there isn’t a better way of doing this, but it’s clearly a weakness Hugo has at the moment and needs to improve. Open to suggestions from anyone on a better approach then we currently use.
I am very new to hugo so I cannot speak from an implementer’s perspective but from an end user’s perspective a straight forward way could be to use Front-Matter that works similar to the draft variable, e.g. like Jekyll uses
@michael_henderson The files slide_1/index.html and slide_1/index.html should not get generated.
I like the idea of the published flag, although for now you could archive the same with the draft flag, couldn’t you? As long you are not generating the drafts explicit.
Also the published sounds like the opposite of the draft flag to me. Maybe naming it hidden would be less confusing?
I’ve implemented remark.js slide shows by pulling the slides in as a partial. That bypasses rendering. Go here and choose Wireless RDMA from the side menu for an example.
Implementation details here
Yes, there is a way.
Put this into the baseof.html
{{ if .Params.render }}
page goes here
{{ end }}
And put this into frontmatter of pages that should be rendered
render = true
All other x.md files will not be rendered by hugo command.
Note: the hugo server will still render all pages.
Note: also put the code into the sitemap.xml How to omit page from sitemap (But use current sitemap.xml from https://gohugo.io/templates/sitemap-template/)