-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Hugo extended #884
Comments
Thanks for the suggestion! For now it seems the workaround to pin the Hugo version does work but I will add this as a backlog item to prioritize.
|
I tried to set the hugo package to extended_{version} using the _LIVE_UPDATES env var but it didn't seem to do the trick.. I settled on a manual install in my amplify.yml preBuild:
commands:
- wget https://github.com/gohugoio/hugo/releases/download/v0.76.5/hugo_extended_0.76.5_Linux-64bit.tar.gz
- tar -xf hugo_extended_0.76.5_Linux-64bit.tar.gz hugo
- mv hugo /usr/bin/hugo
- rm -rf hugo_extended_0.76.5_Linux-64bit.tar.gz |
I spent a couple of hours on this due to Amplify doing some weird quote removal/escaping thingie. In case anybody wants to live on the edge and always use the latest version of Hugo extended, here's the config required: version: 1
frontend:
phases:
preBuild:
commands:
- curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "browser_download_url.*hugo_extended.*_Linux-64bit\.tar\.gz" | cut -d ":" -f 2,3 | tr -d '\\"' | wget -qi -
- tar -xzf "$(find . -name "*Linux-64bit.tar.gz")"
- chmod +x hugo
- mv hugo /usr/bin/hugo
- rm -rf "$(find . -name '*Linux-64bit.tar.gz')"
- hugo version
build:
commands:
- hugo
artifacts:
... |
Is there a proper solution yet? |
Same workaround more or less as what everyone has posted with the addition of following the latest hugo version in amplify by using the preset
This was an intermediate solution for me as I actually set my own env var with the hugo version I want installed and used but just thought I would post it if anyone is interested. Still a workaround of course. |
Do you have any news? |
Will this ever be worked on? Most docs-as-code Hugo users need the extended version of Hugo. |
Still a problem. In the hopes of saving other lost souls on google, my error on build, using the hugo-book theme was: The workaround provided by @pagles worked well (thanks,) but official support is obviously preferable. |
Hey, Same issue here, used the worked around by @pagles for now, but official support defiantly preferable. |
Following up to keep this alive... work arounds by @pagles & @Vlaaaaaaad both are working at this time. Still waiting for official support. |
Does anyone have a working Amplify build yml? I am tearing my hair out with this and I'd love to get it working, but I currently cannot. Using @pagles workaround listed above with the Hugo version override set to "latest" under "Live package updates":
Gets this error:
Because Amplify is still taking v0.75.1 where this shortcode is not supported:
I even tried specifying 0.119.0 in the prebuild command section rather than VERSION_HUGO and disabling the override under Live package updates", and this results in an error about missing the "go" module.....
The Hugo doc (https://gohugo.io/hosting-and-deployment/hosting-on-aws-amplify/) made it sound so easy, but I've lost the better part of an afternoon messing around! |
I just tested that workaround. My build.yml looks like your first example. preBuild:
commands:
- wget https://github.com/gohugoio/hugo/releases/download/v${VERSION_HUGO}/hugo_extended_${VERSION_HUGO}_Linux-64bit.tar.gz
- tar --overwrite -xf hugo_extended_${VERSION_HUGO}_Linux-64bit.tar.gz hugo
- mv hugo /usr/bin/hugo
- rm -rf hugo_extended_${VERSION_HUGO}_Linux-64bit.tar.gz
- hugo version Still works for me with Hugo version 0.118.2. I also tested 0.119.0 without issue. The only difference which comes to mind is that I did not use the Live package updates. Instead, I set VERSION_HUGO under Environment Variables. Try this:
You might also check that Amplify is picking up that it's a Hugo site, under App Settings > General > Framework. My value reads "Hugo" |
Thanks for replying! So I tried your suggestion and this time it picked the correct latest version 0.119.0 via the environment variable, but it's still choking on the missing "go" module:
However, as you suggested I checked the framework and Amplify is detecting my project as "web" and not "Hugo". I guess this might have something to do with it? My repo is in gitlab.com, and I'm using the Git sub modules method, which i suppose could be linked too... |
I have now got this to work. It appears that for my "Go" issue, the "default" image that Amplify offers does not have Go defined on the system PATH environment variable. Once I defined that, it then choked on the familiar PostCSS issue, which was easily rectified with an Anyway for any other lost souls on the internet, this is my build config in Amplify that is now working (don't forget to change your
|
The new If you need to install a newer version than the one in this new image, you can use NPM, the maintainers of Hugo provide a package that's very easy to install |
|
This issue has been automatically locked. |
Is your feature request related to a problem? Please describe.
With default build spec for Hugo, there isn't support for SCSS files which is a feature of Hugo extended. Most of the hugo templates requires SCSS support so Hugo extended version.
Describe the solution you'd like
There can be another build spec for extended version. There is a sample at https://michaux.co/posts/specifying-hugo-version-on-aws-amplify/
Additional context
I believe most of the Amplify users who needs Hugo extended got this issue. It may end up with at least %50 customer lost at this stage.
The text was updated successfully, but these errors were encountered: