1 thing i dislike about hugo

After more than a year of using hugo for test and client projects. 1 thing i really hate is the hugo updates most of the time updates mess up the whole theme or project with no actuall solution on what to do.

Normally issue is solved in next update or if i donwgrade the hugo version. but it is very difficult to downgrade hugo to a previous version.

Something seriously needs to be done with hugo releases.

Thanks

I prefer to download source files for this very reason. I am on windows, so it is as quick as zipping the previous major version, then if something goes wrong, I just delete the newer version and extract the older version. I avoid downloading the minor versions (the x.xxx.1, x.xxx.2 etc.) unless I see something of use in those versions.

1 Like

Hi @tut

Do you know if i can follow the similar setup on mac?

Seems like Homebrew or MacPorts are only available options on mac.

Thanks

With your example from other post is more about remote things.

Save websites, modules and themes offline on your own GitHub so you will not face disappointment when one repo will suddenly be not maintained, supported or simply disappear.

I started Hugo in late 2020 and none of my websites have any issues. I always step behind, currently 0.101 on all, but never face problem.

5 Likes

There are some versions for a mac on the releases page. You can try to search how to build them in mac.

2 Likes

Hi @tut

Tried this didnt work

  1. mac doesnt allow hugo to install as an unknown developer,
  2. the instalation failed with message “wrong cpu type”.

But thanks for the suggestion.

  1. Yes it does. Right click file and click open than you will have option to run even that.
  2. If you got m1 Mac, you need arm64, else Intel or amd64 whatever available
2 Likes

Re #1, you always have to open the Mac’s Security and Privacy settings and give the hugo binary permission to run. The following instructions assume you have a folder (which we’ll call bin) in your system PATH. (Note: Regarding the system PATH, you may want to consult this article.)

  1. Go to Hugo’s releases page and download the file with Hugo software for your Mac. For v.0.102.x and up, it’s a universal binary that will install on either Intel or Apple Silicon CPUs. (I highly recommend you always get the extended version.)
  2. Double-click the file to extract the contents. The hugo file is what you’ll want to move to the bin folder, but don’t do it yet.
  3. Open the Mac Systems Preferences app.
  4. Click the Security and Privacy settings icon. If necessary, click on its General tab.
  5. Click the lock icon and enter the password. This unlocks the “Allow apps downloaded from” area for a few minutes.
  6. Move the hugo file to the bin folder. (If you’re not doing this for the first time, go ahead and replace the hugo file that’s already there.)
  7. Open your preferred Mac terminal app and enter hugo version. You’ll get a warning about the file. Click Cancel.
  8. Back in the Security and Privacy settings window, approve the use of the hugo file by clicking Allow Anyway.
  9. Repeat step 7. This time, you’ll get a minor warning but, this time, click Open to bypass it. In the terminal app window, the hugo version command will be allowed to run and you should see something like the following (this is for v.0.102.3):
hugo v0.102.3-b76146b129d7caa52417f8e914fc5b9271bf56fc+extended darwin/amd64 BuildDate=2022-09-01T10:16:19Z VendorInfo=gohugoio

You’re done.

This may sound like a lot, but after you’ve done it a few times it’ll be second nature. (On the other hand: if you don’t want to try this, you can always stick with package managers like Homebrew.)

9 Likes

I take it that since this post was from today and you described the same problem, you maybe had the same issue I have suddenly had — that unmodified sites suddenly don’t render with their CSS intact? They render without styling on (now current) version 102.3, at least on MacOS (ARM), which you also seem to be using.

Have you seen a thread about this? I spent several frustrating hours trying to chase down the problem, and it seemed to have something to do with permissions on style.css in my Public folder being set to Read Only every time I ran Hugo.

But I only resolved it for the time being thanks to these clear, super helpful instructions on downgrading from @bwintx . It worked for me to downgrade to version 100.3.

2 Likes

Why would a read-only CSS file prevent the CSS from being read and/or rendered? I think that you’re barking up the wrong tree here – you might want to open your preferred browser’s developer console and check what CSS file it tries to load from where.

Hi @chreliot

Do you have a link of what directions you follow as all my attempts are failed on mac. Also hugo seems to be the only package which doesnt support brew install hugo@xxx

The hugo updates mess up this have nothing to do with css or repo or anything else once i am able to downgrade hugo version everything will work as normal. i had waste many hours in past just to know it have to do with hugo version and nothing else.

Thanks

Yes, I uninstalled my Homebrew Hugo with brew uninstall hugo and then just followed bwintx’s instructions above carefully, using the 100.3 version from earlier this summer.

It worked like a lightswitch for another site of mine that had no changes, but lost its CSS/theme if rendered in 102.3. Rendering it in 100.3 brought it back. So, that told me that something in the version itself was the problem, not a bad change I made.

1 Like

That sounds right about the problem. The reason I was looking at file permissions was that the only error I got in my usual build process (when rendering sites in 102.3) was

Start building sites … 
hugo v0.102.3+extended darwin/arm64 BuildDate=unknown
Error: Error copying static files: 
  open /Users/<MY SITE PATH>/public/css/style.css: permission denied

That Error might have been from the rsync step in my deployment script rather than Hugo, maybe?

1 Like

Yes. You might want to check the permissions for your public folder and its descendants. They must, of course, be writable for Hugo so that it can save the HTML and everything else there.

Hi @chrillek

It has nothing to do with the permissions as nothing changes in the repo or in permissions. But the fact is that hugo updates are not reliable and thats the reason most people here even those who are very active stay behind on versions.

Also try installing hugo with brew install hugo@version-here and then try the same with golang or any other package. The only messed up package is hugo every other package can be installed usuing regular homebrew commands.

Hi @chreliot

Are you on mac and using homebrew if yes can you try installing hugo version with the brew command brew install hugo@0.102 to see if it works for you.

The above is a geniun working command you can try with golang for example brew install go@1.18 every package i try installing this way works but not hugo.

Interesting: Copying fails because the permissions are botched, but “it has nothing to do with permissions”.

Yes to the first, no to the second. I simply use the pre-build Mac version from the release page. Homebrew is too much stuff to worry about for me.

1 Like

@pitifi9191

See my Homebrew downgrade comments here:
https://discourse.gohugo.io/t/40388/5

5 Likes