jojomi/docker-hugo

Add option to use extended hugo releases

r3kzi opened this issue · 6 comments

r3kzi commented

Certain hugo themes are using the toCSS function.

Like here
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS

When you use the latest docker image it throws an error like
hugo | Building sites … ERROR 2018/10/19 07:18:14 error: failed to transform resource: TOCSS: failed to transform "style.coder.css" (text/x-scss): this feature is not available in your current Hugo version Total in 23 ms

In contrast when you use the hugo cli and specifically the extended version hugo_extended_0.49.2_Linux-64bit.deb, it works just fine.

Is there a way to make the use of the extended version in your dockerfile configurable?

Not that I did not try before! It is not that easy unfortunately. The point are the dependencies needed that are making the usage hard in a Alpine image. At least that was the case the last time I checked…

If you can make it work, I would happily merge a MR though :).

r3kzi commented

@jojomi so what do you think about my MR? :-)

I will have a look, thank you!

@Rekz1 I merged it and added some test code. Would you mind testing the current latest build (based on hugo v0.49) and share your feedback? Thank you!

r3kzi commented

@jojomi thanks! It works for me:

hugo    | Watching for changes in /src/{content,layouts,static,themes}
hugo    | Watching for config changes in /src/config.toml
hugo    | Serving pages from /output
hugo    | Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
hugo    | Web Server is available at //localhost:1313/ (bind address 0.0.0.0)
hugo    | Press Ctrl+C to stop

Tested with:

$ docker run --rm jojomi/hugo:0.49 hugo version                                                                                                     
Hugo Static Site Generator v0.49 linux/amd64 BuildDate: 2018-09-24T10:03:17Z
$ docker inspect --format='{{index .RepoDigests 0}}' jojomi/hugo:0.49           
jojomi/hugo@sha256:7093287666f10357accf1099ba40eaaf92a8d714ccc7a1ad657065293900456b

Thanks for your feedback! The next release (0.50) will include this change then. Plus the latest tag on Docker hub.