I am a novice user of hugo.
I am using Hugo Static Site Generator v0.73.0/extended linux/amd64 BuildDate: unknown
(in homebrew on a ubuntu 20.04 install)
I expected that pages with
draft: true
in the front matter will be visible on
localhost:1313
but they are not. draft: false is fine btw.
I am not using a theme. What could be wrong?
Please post a link to the public repository for your site. See:
https://discourse.gohugo.io/t/requesting-help/9132
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 runhugo 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.
First let me say: Thank you for coming back. Then: Fortunately I was able to figure it out by myself. In case others run into the same problem I’ll try to explain what I think has happened.
I copied a template from a theme into my learning project. The template happend to have code like:
{{ $blogPages = where $blogPages ".Params.draft" "!=" true }}
So no matter what I specified on the command line, the draft did not show up. However I am left wondering if the template just is “bad style” or if I did not yet understand fully the purpose of the draft flag.
It would be nice to have an example site showing “good practice” to learn from.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.