Closed stephenfin closed 5 years ago
This has caught me out before and I doubt I'm the only one. Ideally, I think the build/serve operations should fail to run in the above case
First, I suspect you are running an old version of Hugo. But are you sure it does not fail to run? And by failing I mean: 1) Log an ERROR and 2) Exit with an exit code != 0 (also note that we do not stop the server on errors, that would be just painful ...)
Thanks for the quick reply. Indeed, my version does look quite old:
$ hugo version
Hugo Static Site Generator v0.37.1 linux/amd64 BuildDate
(I see the latest appears to be 0.54.0).
This is the version packaged on Fedora. I can probably encourage someone to update this.
You are also correct in suggesting that the exit code is non-zero (255, to be exact) and that stopping the server on error would be painful. The exit code wasn't much more obvious than the error log though.
What are your thoughts on including the errors in the built document when using the server? We probably don't want to include it in the built docs but that could be configurable, I guess.
What are your thoughts on including the errors in the built document when using the server? We probably don't want to include it in the built docs.
This feature is added in Hugo 0.50. It's called 'browser error' in Hugo and they don't show when you build the site (only appear with hugo server
).
This is the version packaged on Fedora. I can probably encourage someone to update this.
This Fedora Copr version is updated till 0.54. Here's a list of other places where you can fetch the latest Hugo package.
Excellent, thanks. Seems like this is resolved and I just need to use that Copr or encourage someone to update the main repo. I guess this can be closed now
For anyone that stumbles upon this, it seems Fedora 30 will include Hugo 0.54. One less thing for me to do \o/
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.
I'm switching my docs from rST to Markdown and trying to take advantage of shortcodes in the process. However, I am noticing some usability issues in the process. I created something like this:
When I ran
hugo serve
, none of the shortcodes were rendered. I noticed the following logs:However, I didn't pay much attention to this because the thing still ran and sort of rendered. Eventually I figured out that if I dropped the
{{% note %}}{{% /note %}}
shortcode, the{{<gist>}}
one suddenly started working. Once I'd figured that out, I realized that the definition of the former in the docs was only given as an example and is not included out of the box.This has caught me out before and I doubt I'm the only one. Ideally, I think the build/serve operations should fail to run in the above case. Alternatively, I think the broken shortcodes should be replaced with some kind of warning that states that there is an issue (this is what docutils does). In any case, it really shouldn't just fail sort of silently like it's doing here.
I can try fix this myself but I'd like to know if the idea is sound before I invest the time in an unwanted fix.