-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Print error/warning and suggest solution if a page is rendered empty #947
Comments
There are warning-loggings about this:
|
@bep, awesome! I didn't know that! That would be a great place to start adding helpful messages for newcomers. I will hopefully look into it deeper in a week or two after I finish my paperwork, haha! |
Conversly, hugo currently generates 0-sized files like this one just because a layout is missing. I'm not planning to add a layout for it, as I don't need that page. If empty pages is going to be an error, I'd like to get an option to kill generation of empty pages, so this kind of thing is not a generation failure. |
+1 for @yacoob - the zero bytes pages are annoying. All options (warn, fatal error, or silently remove empty pages) would by nice to have. |
+1 |
Also print warning (in verbose mode) for other empty pages. See #947
Hi all, I have just pushed a commit 0d1d33d that would output a big fat error when the home page is empty:
and warnings for all other empty pages if Is this a sufficient solution for this issue #947? Or should more error checking and warnings be made? |
When using hugo to generate html files that are then uploaded to s3, it would be better to be able to stop these from being written to disk at all - they cause a 200 blank page, and prevent the 404 handler from showing the user something useful. |
Also print warning (in verbose mode) for other empty pages. See gohugoio#947
This issue has been automatically marked as stale because it has not been commented on for at least four months. The resources of the Hugo team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, and you feel that it is still valuable, please open a proposal at https://discuss.gohugo.io/. This issue will automatically be closed in four months if no further activity occurs. Thank you for all your contributions. |
Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't. If this is a bug and you can still reproduce this error on the latest If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. |
FWIW I'm getting zero logs for corresponding empty pages, I can't seem to set an explicit layout either, so I just get blank pages with no explanation. A 404 would at least be better, not really sure what's going on, I don't have an empty template etc. Ideally in development dumping a list (or logging) of the attempted layouts would be really helpful, it's really hard to debug and makes it more difficult to learn Hugo. I keep finding cases that seem like they should work just fine, but lead to resolving to the wrong template or nothing at all. |
Also print warning (in verbose mode) for other empty pages. See gohugoio#947
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. |
See http://discuss.gohugo.io/t/generated-post-page-is-empty-solved/835
This is one of the first hurdle that I ran into too,
and sometimes still run into when starting a new website,
or when experimenting with a new theme.
So, it would be nice if Hugo could do a quick check to see if any generated files are empty, especially
public/index.html
, and emit a warning/error message, and perhaps offer possible solution to the end user, e.g. check thelayouts/
directory, or use a theme, etc.The text was updated successfully, but these errors were encountered: