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

content_map_page: Ensure homepage exists #11491

Closed
wants to merge 1 commit into from

Conversation

vladh
Copy link

@vladh vladh commented Sep 24, 2023

Previously, it was possible to create an _index.md, but have it not be built, such as by setting draft: true. This would result in there being no homepage, and when e.g. a theme would call .Site.Home, this would result in a “runtime error: invalid memory address or nil pointer dereference”. Now, if the homepage does not end up being built, we fall back to creating a default homepage, as if _index.md never exited.

Fixes #11441

Previously, it was possible to create an _index.md, but have it not be
built, such as by setting `draft: true`. This would result in there
being no homepage, and when e.g. a theme would call `.Site.Home`, this
would result in a “runtime error: invalid memory address or nil pointer
dereference”. Now, if the homepage does not end up being built, we fall
back to creating a default homepage, as if _index.md never exited.

Fixes gohugoio#11441
@jmooring
Copy link
Member

Closing in favor of #11894.

@jmooring jmooring closed this Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Draft _index.md gives "invalid memory address or nil pointer dereference"
2 participants