I’m still getting the draft export problem. I upgraded to latest latest 0.59 and it still happens.
Any new draft or existing ones set to true are still exported to public when built. And the files have content, they are not empty.
No, I don’t use taxonomies.
Yes, I cleaned my public folder everytime.
---
bg: "pt-3 pt-md-5 mt-md-5"
bttmTrackingCta: ""
# SEO
title: "Some title"
description: "Interdum montes bibendum venenatis enim libero sed tortor litora justo ad posuere, neque at aliquam pharetra ligula auctor ac massa velit platea, nec mattis curabitur nibh etiam scelerisque nunc vestibulum praesent netus. Fermentum mollis elementum mus orci suspendisse finibus netus primis, risus etiam urna penatibus tempus euismod vivamus id consequat, faucibus fames magnis luctus sed malesuada condimentum.."
imageURL: "/"
linkURL: "/"
Seo: "noindex,nofollow"
# Content Types
type: ""
layout: ""
draft: true
weight: 2
---
Let me make you aware of the draft export problem:
Unfortunately I can’t provide a repo since this is a private company repository and I’m also not allowed to publish the code. I will get back with a dummy repo and try to remove confidential information from it.
@alexandros is right. If you want “leaf bundles” (also known as Regular Pages), structure your pages either like this (which includes three “leaf bundles”):
Note that the draft key works in either of the above directory structures (even in v0.59.0)
IMHO, it is best to avoid using a leaf bundle unless you actually need a directory for, e.g. resources, for a RegularPage.
IMHO2, it is best to avoid the terminology “leaf bundle” and “branch bundle” and instead use terms like “RegularPage” and “List Page” - I’m not sure what is good terminology but I’m pretty sure it does not include any of these strings: “leaf”, “branch”, “node” … Maybe good terms are “RegularPage (bundle)”, “RegularPage (non-bundle)” and “List Page”.
IMHO3: Terminology is hard.
IMHO4: If there were a Hugo FAQ, the distinction between index.md and _index.md would be #1.
This worked before Hugo 0.57.
The fact that I’m using it wrong, I’m aware of.
I still don’t see anyone mention that this changed after 0.57 update.
At my company, Hugo was somehow forced into our workflow, although we just have a static site, with a few pages. Nothing related to articles or a blog type, which I think Hugo is more suited for.
So the most I have in regards to subpages is:
homepage → our credit cards
or
homepage → account details → something more about the account
And how I use it is exactly like this.
In content I have folders for each subpage, with _index.md being my homepage.
In layout I have folders for each subpage, with index.html being my homepage.
Is there any other way I should structure my content to enable drafts?
Also:
If you need to disable these sections and all of their children I suggest that you enter them in the ignoreFiles array of your config.
This is such an ugly way of hardcoding things. I mark something if it’s a draft, not by the name it is sitting on.
I downloaded and built your site with Hugo v0.59.0 and drafts work if you rename _index.md to index.md for your Regular (non List) Pages. I edited my comment above so it now includes
←note no underscore
in the relevant parts of your directory structure.
It’s weird that your current directory structure worked before
Thank you _nm . This is the solution and things work back normally again.
As I said, I’m aware I was not using the leaf/branches normally (stupid terminology to be honest, or if you want to go this route, have a small drawing in your documentation showcasing examples of a tree and what a branch would look like as a folder, what a leaf would look like etc.).
Not sure why it worked before, but I did try to install 0.56 and drafts were working (probably it was not supposed to).