Getting different outputs from the same repo! (Hugo)
Hi - I have a Hugo blog that I'm deploying from a github repo.
When I run
hugo server --watch --ignoreCache
locally on the repo, everything shows up correctly, but when CF builds and deploys it, it's missing some key elements (the theme is not rendered correctly).
I can't figure out what the problem is.
Same repo, and same hugo version (117) on both local and CF.
Any help would be much appreciated4 Replies
Is the theme in your repo? Or being included as a submodule?
Is your repo public?
Hi
The theme is not a submodule, itβs inside the repo.
The repo is not public, but I can give you access if you want to take a look.
Nothing private in there
I somehow solved it.
There was one specific category that wasn't using the right layout when deployed on CF - I edited and pushed the
_index.md
in that directory, now it's working.
It's not a real solution because I don't know what was wrong really, but somehow it fixed the problem and now that category is using the right layout.
Interestingly enough, I added posts in that category before but it didn't do the trick. Editing _index.md
did Β π€·ββοΈ
Also I was under impression that the site gets rebuilt completely from scratch each time - is CF pages using any types of build cache that wasn't getting purged properly? π€No, there's no build cache (yet). Since there is a build cache with Hugo when you use it locally, its absence can actually cause unexpected behavior if you have a problem in your code that the cache is obscuring. It can be a good idea to test locally by deleting both the
public
directory and the resources/_gen
directory. It sounds like your problem was more with Hugo than with Cloudflare in this case.True.
Sounds like it.
I use
--ignoreCache
with hugo when seeing the changes locally though.
Thanks for the help π