✓ Solved

How do I get hugo static site in object storage to use theme

I'm testing linode.com as a new site for my blog. I've set up a test site in object storage with the url https://blog.onreligion.com. I'm using hugo to generate the static site.

When I look at the site on localhost (using <hugo server="">, the site is formatted as expected. So I generate the site using <hugo -v=""> and upload the public directory to the block storage.</hugo></hugo>

But when I access the site, I see all the content and the links work. But the styling is wrong.

Surely this is user error, but I can't figure it out. What do I need to change?

Thanks.

2 Replies

✓ Best Answer

We have a guide on how to Creating A Static Site With Hugo & Object Storage. I mention this guide because I think the solution to your problem is in it.

Checking The Theme

The fact that it doesn't appear after you used the hugo -v command makes me think that the theme isn't properly set. The hugo -v command generates the site's static HTML files using what was set up prior. So you are going to want to check the config file to see if the theme is declared in it. To do this you first need to cd to the root directory of you Hugo site, not to be confused with the systems root directory. Then use nano or cat on the config.toml to see if theme = is located in the file. If not you can use the command echo 'theme = {Name of Theme}' >> config.toml to add it to the config file.

Updating The Files

Once you have done the above you will need to again use the hugo -v command to update the HTML files your generated before. Using CyberDuck, s3cmd, or your S3 uploader of choice, you will need to either sync the updated files or replace the existing files with the updated ones.

Check the Object Storage Bucket

The only other possibility I can think of would be to check to the Object Storage Bucket to make sure all the proper files were uploaded.

-Dan

Thanks, Dan.

I was already working with the guide you mention, and I'd also specified the theme. But your response took me back to the guide, and I found I missed a crucial step.

So user error, indeed. Sorry for the noise.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct