Primrose theme redirects, category pages, and Hugo compatibility

I’m using the Primrose theme with custom edits, with the 0.54 version of Hugo, on TIL. I have a few issues:

  • When using a redirect, there is a flicker when loading the page. I think this was supposed to be fix with this update but it’s still happening. For example: the Tips category page.
  • On category pages, like the aforementioned Tips, the filter is not applied at all but instead just shows all posts. Again, I think this was solved elsewhere but I can’t remember if the fix was applied to Primrose or not.
  • When updating the Hugo version to 0.91, all posts on the homepage disappear.

I have a feeling the update to 0.91 might fix the other two issues, and maybe that third issue is a conflict with my custom edits. But since I don’t know for sure and have barely any experience dealing with Hugo templating and version compatibility, I don’t know any quick fixes or anything like that.

I wanted to post these here in case other people come across the same issues and aren’t sure if they should be reported via email.

The blank home page with 0.91 sounds like the same thing we’ve fixed in other themes, so we probably missed it in Primrose. I can update the Primrose plug-in.

Actually I’m not seeing a problem with Primrose. Make sure you’re using the version under Plug-ins since that will be the latest. If it’s still not working, maybe there’s a custom version of the index.html or list.html templates that still has the old behavior.

Yep. There’s something wrong with how I’ve implemented custom code for the post footer. This might also be messing with the category pages.

Now I at least know enough to try to work this out. Next up: learn Hugo. Very much at the point where I no longer have the patience for copying other people’s stuff without knowing how it works… also, on the positive side, it’s primarily because I want to do much more with regard to customising my sites.

I’m gonna just stay on 0.54 and later learn enough to adapt the custom code.

Yep, this was it. The home page posts now appear. Still working on the category pages redirect and post type issues.

Redirect issue is fixed by changing the header: .Page.Params.redirect_url.Page.Params.redirect

The remaining issue is the category pages not loading correctly. Going to test some of my categories settings just in case the problem is coming from that side of things.

Edit: This isn’t the fix I thought it was. Instead, it just stops using the cleaner URL and reverts to the full URL.

@manton I’ve copied the site menu code from the repo here and put it into the header for TIL. As a result the redirecting page URL (/tips or /guides) is now being ignored and instead the real URL is used.

The previous code included redirect_url whilst the new code removed _url. I don’t know if this is a Hugo thing, for the newer version, or something else.

You’re right, at some point this changed, possibly not on purpose. It looks like we’re going to need to update the themes.

1 Like