Hugo 0.20 upgrade ; page template breaks

I’m using Hugo 0.20 on Darwin, with the Casper theme, hosted on Github. I had previously been on Hugo 0.17.

When I build locally and run under a server, the pages load just fine.

When I build and deploy to Github, no images show, and there’s no CSS. It looks like something is rendering baseurl wrong:

<meta property="og:image" content="http://vielmetti.github.ioimages/cover.jpg"/>`

but it is set properly in config.toml

BaseURL = "http://vielmetti.github.io/"

Ideas? I looked everywhere I could, there’s probably a cache somewhere I missed.

@vielmetti I’m guessing it has to do with the way the stylesheets are called. Can you point me to your GH repo please? Shooting from the hip, I’m guessing we can fix this with relURL and absURL.

https://github.com/vielmetti/vielmetti.github.com is the repo with what gets published.

I also get this warning at load time:

WARNING: Site config's rssURI is deprecated and will be removed in a future release. Set baseName in outputFormats.RSS.

Ah, okay. I’m more interested in the theme files…and the site source. This is the built site, which helps me less.

Do you run a flag at build time or do you keep it configured in your config file?

Can you point me to a repo for the site source?

@rdwatters check your email for an invite, the repo itself is private but I’ve added you as a collaborator for the moment. (nothing secret about it, but I didn’t want to publish it).

Here is the culprit, I’m guessing:

I would create your own version of this file in your layouts and call the stylesheets like so…

<link rel="stylesheet" type="text/css" href="{{ "css/screen.css" | relURL}}"/>
<link rel="stylesheet" type="text/css" href="{{ "css/nav.css" | relURL }}"/>

Create this in layouts/partials/header.html of your root project directory (along with everything else copied and pasted over from the same partial)…

Let me check on the images…

I was able to make a simpler fix.

My build script reads

/usr/local/bin/hugo -b http://vielmetti.github.io -d ../vielmetti.github.com --theme="casper"

and -b overrides the BaseURL. When I change to

/usr/local/bin/hugo -b http://vielmetti.github.io/ -d ../vielmetti.github.com --theme="casper"

all is well again.

Ah, hence my question on whether you build it with a flag. You were actually leveraging a bug before, which is now fixed :smile:

https://github.com/spf13/hugo/issues/3262

Glad there’s a bug fix! It was easy to diagnose once I looked at all of the files that I depended on.

1 Like

I was just going to comment w/ that, .v20 fixes the trailing / problem so that is why your baseurl is being inconsistent.

:slightly_smiling: