[SOLVED] Website not rendering correctly

Hi guys,

This is the first time I’m using Hugo to make a website, and I have some problems right now figuring this out. Hugo is pretty straightforward, but I can’t seem to render the website correctly using the static files in the public directory. I’ve tried googling for the solution, but I don’t seem to be able to use the right terminology to find a solution, so I guessed I’d try on here.

So basically I am using the “Hugo-Fresh” theme. This theme uses Node.JS and Yarn to render the CSS on the page. After installing and configuring this software, using the command “hugo server” gives me a correct render of the page. But when I try to use the files in the “public” directory to deploy my website, the layout is all messed up and not showing correctly. Do I need Node.JS and Yarn etc. to use the theme on my server? If so, what’s the point of generating a static website?

I hope that the solution is easy, and if I need to use a different theme that doesn’t use the abovementioned software, I’ll do that.

Thanks in advance for any advice you guys might have for me!

The theme requires that you run Makefile commands to run: https://github.com/lucperkins/hugo-fresh#running-this-theme-locally If you follow the instructions there line-by-line I’d think it would work for you.

though, just to note that where the theme author has parenthesis, I believe you just ignore those:

so, just run this: cd themes/hugo-fresh && make setup && make dev

Thank you for your reply! Running the commands makes the website render correctly when using “hugo server”, but when I deploy the contents of the public directory to my server using nginx, the website doesn’t seem to render correctly

I have found what the problem is, the html files linked to example.org by default, what caused the CSS files to not be available

1 Like