I will cut a new Hugo 0.39 release on Monday. This will mostly be a technical stabilizer release. Which is easier to handle when we don’t have lots of other stuff in there as well.
So, I have rewritten the /commands package, now with 55% test coverage. With is better than the 11% we had before, but there are chances that I have mocked up something … So if you can compile from source and test this and report back any glitches, related to:
The CLI commands (hugo, hugo server, … with flags)
General Hugo usage (hugo, server with reload etc.)
Thanks, I seem to have forgotten about those global flags – which worked before because we had … global everything. I will figure a good way to fix those.
Confirming that mine is returning the full path as well:
Watching for config changes in /Users/rcogley/path/to/config.toml
My env:
~/d/eSolia_2018 ❯❯❯ hugo env
Hugo Static Site Generator v0.39-DEV-F3775877 darwin/amd64 BuildDate: 2018-04-12T19:38:34+0900
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.10.1"
While working on that “baseURL with subdir” tests, I discovered that livereload has stopped working in the latest build… my command:
hugo server -p 6767 -b localhost/foo/ --navigateToChanged
To be specific, the livereload works if changes are made to the content files, but doesn’t work if changes are made to a layout file like layouts/_default/single.html.
Interestingly, message like this get printed too, but no livereload:
Change detected, rebuilding site
2018-04-13 01:03:18.491 -0400
Template changed "/home/kmodi/sandbox/hugo/sandbox/subdir-canonify-true/layouts/_default/single.html": WRITE
Total in 21 ms
The livereload works fine for other sites where the baseurl does not have a subdir.
INFO 2018/04/13 09:41:16 Using config file: .config.w3css-basic-exampleSite.toml
Building sites … INFO 2018/04/13 09:41:16 removing all files from destination that don't exist in static dirs
INFO 2018/04/13 09:41:16 syncing static files to /home/~~cut~~/working/github.com/it-gro/hugo-theme-w3css-basic/exampleSite/public/
INFO 2018/04/13 09:41:17 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
~~~ cut ~~~
-d /data/scratch/tmp/ is "ignored"
hugo-0.38.2 gives me:
INFO 2018/04/13 09:43:33 Using config file: .config.w3css-basic-exampleSite.toml
Building sites … INFO 2018/04/13 09:43:33 removing all files from destination that don't exist in static dirs
INFO 2018/04/13 09:43:33 syncing static files to /data/scratch/tmp/
~~~ cut ~~~
Hugo Static Site Generator v0.39-DEV-2AAB6DEE darwin/amd64 BuildDate: 2018-04-13T17:13:14+0900
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.10.1"
… when I run:
hugo server --navigateToChanged --buildDrafts --watch --verbose --source="/path/to/eSolia_2018" --renderToDisk --cleanDestinationDir --destination="/tmp/estesting" --config="/path/to/eSolia_2018/config.toml" --port=1366
In terms of corroboration, I’m observing the same thing as @it-gro when trying to render to disk. Nothing is created in /tmp, but rather in the project folder’s public folder.
INFO 2018/04/13 17:25:28 Using config file: /path/to/eSolia_2018/config.toml
Building sites … INFO 2018/04/13 17:25:28 removing all files from destination that don't exist in static dirs
INFO 2018/04/13 17:25:28 syncing static files to /path/to/eSolia_2018/public/en
INFO 2018/04/13 17:25:28 removing all files from destination that don't exist in static dirs
INFO 2018/04/13 17:25:28 syncing static files to /path/to/eSolia_2018/public/ja
INFO 2018/04/13 17:25:29 found taxonomies: map[string]string{"topic":"topics", "series":"series", "tag":"tags"}
INFO 2018/04/13 17:25:29 found taxonomies: map[string]string{"topic":"topics", "series":"series", "tag":"tags"}
...
Total in 1301 ms
Watching for changes in /path/to/eSolia_2018/{content,data,i18n,layouts,static}
Watching for config changes in /path/to/eSolia_2018/config.toml
Serving pages from /path/to/eSolia_2018/public/en
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1366/ (bind address 127.0.0.1)
Web Server is available at http://localhost:1367/ (bind address 127.0.0.1)
Press Ctrl+C to stop
Besides the destination dir getting ignored, this site is bilingual, so while the server is correctly binding two ports for me so I can see both langs of the site, is it accurate to say: Serving pages from /path/to/eSolia_2018/public/en only?
OK, I have made another pass on QA on the flag handling. There were 2 flags with a mismatch between the flag name and the config key in Hugo that I missed when I removed them as global vars: destination and i18n-warnings. I have now fixed those + added test +.
@bep do you think we could fix optional positional parameters for shortcodes in 0.39 so that they can be used alongside with/if/cond (just like named parameters) ?
I was just awaiting for confirmation that a different behaviour is expected:
If everybody agrees positional params should return an empty value too (so that they can be chained with with or if to check for their existence), I will be glad to make a PR to fix this. @bep, what do you think?
Either this or I can document the current behaviour, whichever you think is more appropriate
@bep yep, now it’s working. I’m getting files created in the folder I expect, using --renderToDisk.
~ ❯❯❯ hugo env
Hugo Static Site Generator v0.39-DEV-27A524B0 darwin/amd64 BuildDate: 2018-04-14T21:01:14+0900
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.10.1"
Yea, it seems to work correctly for the server, but not for the regular hugo. Well spotted, thanks. Which just shows the importance of getting good test coverage in this area.