Hugo 0.39: Help test it!


#1

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 a heap!


#2

Cursory tests show no problems for me so far, for what I am usually doing.


#3

Something may happend to --config :

$ hugo-0.38.2 -w server --themesDir ../../ --config .config.w3css-basic-exampleSite.toml
~~~ cut ~~~

Watching for config changes in .config.w3css-basic-exampleSite.toml

$ hugo-0.39-DEV-F377587 -w server --themesDir ../../ --config .config.w3css-basic-exampleSite.toml
~~~ cut ~~~

Watching for config changes in /home/~cut~/it-gro/hugo-theme-w3css-basic/exampleSite/config.toml

$ hugo-0.38.2 env
Hugo Static Site Generator v0.38.2 linux/amd64 BuildDate: 2018-04-09T08:17:17Z
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.10"
$ hugo-0.39-DEV-F377587 env
Hugo Static Site Generator v0.39-DEV-F377587 linux/amd64 BuildDate: 2018-04-12T17:33:17+0200
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.10"

#4

same issue for notation with ,: --config config.toml,config.local.toml

0.38.2:
Watching for config changes in config.toml
Watching for config changes in config.local.toml

vs

0.39-DEV:
Watching for config changes in /home/~cut~/github.com/it-gro/HugoTemplateCodePlyGnd/config.toml


#5

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.


#6

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"

#7

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.


#8

Thanks, I suspect it is connected with the above.


#9

@it-gro https://github.com/gohugoio/hugo/commit/2aab6dee850517533683504a6158e0ef0a3ffc57 should fix the issues reported. Thanks for testing, really appreciated!


#10

hugo-0.39-DEV-2AAB6DE => reported issues with --config gone :+1:


#11

Now I run into another one. I see this was also the case with hugo-0.39-DEV-F377587

hugo-0.39-DEV-2AAB6DE -v --baseURL "https://it-gro.github.io/hugo-theme-w3css-basic.github.io/" --themesDir ../../  --cleanDestinationDir -d /data/scratch/tmp/ --config .config.w3css-basic-exampleSite.toml

=>

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 ~~~

#12

Given:

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?


#13

Will check … I may have been a little quick on the button on this. I will do some testing on my side.


#14

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 +.


#15

@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 :slight_smile:


#16

@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"

#17

This works as in 0.38.2:

hugo-0.39-DEV-27A524B server -w --baseURL "https://example.com/foo" --themesDir ../../   --config .config.w3css-basic-exampleSite.toml

template snippet:

<link rel="stylesheet" href='{{ relURL `vendor/fontawesome/css/fontawesome-all.min.css`                  }}' />

renders to:

<link rel="stylesheet" href='/foo/vendor/fontawesome/css/fontawesome-all.min.css' />

now using

hugo-0.39-DEV-27A524B --baseURL "https://example.com/foo" --themesDir ../../  --cleanDestinationDir --destination /data/scratch/tmp/ --config .config.w3css-basic-exampleSite.toml

it renders (wrongly) to:

<link rel="stylesheet" href='/vendor/fontawesome/css/fontawesome-all.min.css' />

note the missing foo

$ hugo-0.39-DEV-27A524B env
Hugo Static Site Generator v0.39-DEV-27A524B linux/amd64 BuildDate: 2018-04-14T21:57:55+0200
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.10"


#18

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.


#19

#20

:+1: issue gone - thx so much for all your work