I have scheduled Hugo 0.50 for Monday, and it would be helpful if you took the latest source for a spin if you know how to compile it.
The 2 big items here are:
The server Fast Render mode (the default when you run hugo server) should now work “without holes”; that is: If you make a change, and then navigate to a “totally different page”, that page should reflect the recent change.
Major overhaul of errors with a full filename with line/column location whenever possible. Also, we now show errors in the browser in server mode.
The last item was more work than it looks. For one it meant a rewrite of the “page parser” logic in Hugo. This has some additional benefits (now and in the future, it is also faster, as we now do it once), but the main point here is that we now know the exact byte position when something fails on a page. We had some great test coverage in this area, with some odd corner cases that saved my ass a few times, so I feel pretty confident – but shout if I have screwed up.
I just rebuilt using the master, and everything works just as before; it’s boring (and that’s a great sign of a massive under-the-hood refactoring and improvements going well).
I saw the hugo server panic once (unable to reproduce that consistently though). All I did was change disableFastRender from true to false in my site’s config.toml while the server was running, and I got:
Change detected, rebuilding site
2018-10-24 13:53:44.191 -0400
panic: no pageOutput
goroutine 10415 [running]:
github.com/gohugoio/hugo/hugolib.pageRenderer(0xc0004ea300, 0xc000bdd080, 0xc000bdd020, 0xc007e825b0)
/home/kmodi/go.apps/src/github.com/gohugoio/hugo/hugolib/site_render.go:119 +0xd24
created by github.com/gohugoio/hugo/hugolib.(*Site).renderPages
/home/kmodi/go.apps/src/github.com/gohugoio/hugo/hugolib/site_render.go:43 +0x160
That flag was meant to be provided as a CLI flag and not changed while the server is running. I will remove it from the “config”, and this problem will go away.
I know there are users on the forum with varying degrees of familiarity and comfort when it comes to installing from source, etc, so for a beginner friendly way for Mac users using Homebrew to try out the latest features, I keep it simple and added the following alias to my ~/.bash_profile:
alias updatehugo="brew uninstall --force hugo && brew install --HEAD hugo"
Then I just type updatehugo, which just now updated me to HEAD is now at 78a4c2e commands: Read disableFastRender from flag even if it's not changed, which you’ll notice is the latest commit to master. Yes, there are other ways, and this is boring for many on the forums (myself included), but hoping it gets more OSX users to test and provide feedback for this and other wicked-cool features
@kaushalmodi I don’t mean to bring this thread off-topic, but something like the below would keep you from typing out the --disableFastRender flag on CLI every time. You could just run hugo server as normal.
hugo() {
if [[ "$@" == server* ]]; then
options="${@#'server'}"
command hugo server --disableFastRender "$options"
else
command hugo "$@"
fi
}
Good tip. I have reverted the above change, it’s not worth the potential noise. I will, if I remember, fix the crash you get when changing it when the server is running.
And I think there are many that use clever Bash aliases to start the Hugo server in different modes.