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

hugolib: Add option to disable rendering of 404 page #2037

Closed
wants to merge 1 commit into from
Closed

hugolib: Add option to disable rendering of 404 page #2037

wants to merge 1 commit into from

Conversation

digitalcraftsman
Copy link
Member

Fixes #1889

nfLayouts := []string{"404.html"}
if nfErr := s.renderAndWritePage("404 page", "404.html", n, s.appendThemeTemplates(nfLayouts)...); nfErr != nil {
return nfErr
if !viper.GetBool("Disable404") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's much easier to read if you do if viper.GetBool("Disable404") return nil instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I inverted the logic.

@bep
Copy link
Member

bep commented Apr 9, 2016

Could you rebase this against master?

@digitalcraftsman
Copy link
Member Author

Done

@bep bep closed this in b7efbdc Apr 9, 2016
@digitalcraftsman digitalcraftsman deleted the disable404 branch April 9, 2016 18:26
tychoish pushed a commit to tychoish/hugo that referenced this pull request Aug 13, 2017
@github-actions
Copy link

This pull request 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 Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to not generate a 404 page
2 participants