-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Revert to .Type = "page" when empty #6805
Comments
I don't see anything about this on the page you link to. I don't see anything anywhere in the docs about this. The |
Thinking about this and the reasons behind #6760 are probably not important enough considering the potential for problems with existing sites. I did check the documentation before doing this and assumed this was a hidden and unused feature. |
Thanks for considering this. Just for completion sake, wrt your comment
This is what the link I mentioned says:
which I interpreted to mean that it should have the .Type as page. |
This was changed with good intentions in 0.63.0. This behaviour was not documented, but it was of course in use. This commit rolls back to how it behaved before: For `Page.Type` you will get: * `type` from front matter if set. `* `.Section` * If none of the above returns anything, return "page" Fixes gohugoio#6805
I admit it can be confusing, but those terms are not the same. |
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. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
The home page is supposed to be a "page" as mentioned here https://gohugo.io/templates/homepage/
However, from 0.63.0 onwards, the .Type for homepage does not return page anymore, rather blank. I believe this is a side effect of #6760
This was discovered via my use of the beautifulhugo theme, which has this code to select appropriate styling for the subtitle depending on whether a page or post is being generated: https://github.com/halogenica/beautifulhugo/blob/1ff3894b84b1802433b58e22dd22f4eb46a49fa9/layouts/partials/header.html#L70
Before 0.63.0, it generates "page-subheading" as the class as can be seen on https://shantanugoel.com/
0.63.0 onwards, it generates "-subheading" as the class.
The text was updated successfully, but these errors were encountered: