Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hugo 0.30.2 doesn't see subsections with _index.md only in them #3989

Closed
mpaluchowski opened this issue Oct 21, 2017 · 6 comments
Closed

Hugo 0.30.2 doesn't see subsections with _index.md only in them #3989

mpaluchowski opened this issue Oct 21, 2017 · 6 comments

Comments

@mpaluchowski
Copy link

mpaluchowski commented Oct 21, 2017

Hugo 0.30.2 (haven't tested .0 nor .1 but it did work correctly up to 0.29) seems to be ignoring non-first-level sections which only have _index.md in them, both in .Sections and where .Site.Pages "Kind" "section" queries.

Ie. for the following structure:

/content/a/_index.md
        /b/c/_index.md
          /d/_index.md
            /some-content.md

the query where .Site.Pages "Kind" "section" will only return:

  • a and b -- because they're first-level
  • d -- because it contains some-content.md

while c will be missing.

@bep
Copy link
Member

bep commented Oct 21, 2017

Thanks for the report; with the change log from 0.29 I find this strange, but your issue report is good, so I will look at this shortly.

@bep bep added this to the v0.31 milestone Oct 21, 2017
@bep
Copy link
Member

bep commented Oct 21, 2017

Do you have a public site source showing this issue?

@mpaluchowski
Copy link
Author

Yes. Here's my site and the corresponding theme.

You can see the issue when you go to triathlon.paluchowski.com/races -- there are 4 items on the list, this one built with 0.29 -- but when you build it with 0.30.2 the top 2 items (with the gray headers) will be missing. These are the sections with _index.md only.

@mpaluchowski
Copy link
Author

Oh, wait, now I found the issue. The commit 6a30874:

if p.PublishDate.IsZero() {
  p.PublishDate = p.Date
}

The two items I have on the /races page have both future dates (because they're upcoming races I'll be participating in). The above change though interprets these date values as future publishing dates and hence the items won't render, unless I pass --buildFuture to the build command.

This is obviously not what I want nor expected to happen :) If I wanted a piece of content to be published in the future, I would've used the publishDate field explicitly.

Can we get the old behavior back?

@bep bep added the Duplicate label Oct 22, 2017
@bep
Copy link
Member

bep commented Oct 22, 2017

See #3977

@bep bep closed this as completed Oct 22, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants