If I created a new theme with Hugo and initially chose the wrong name, will renaming the theme later have any impact on Hugo's functionality?

Hello,
I created a website and theme using the commands:

$ hugo new site nameofsite
$ hugo new theme blush

I initially named the theme blush because the background had a very light pink hue. However, I’ve since changed the overall design and color scheme of the website, and the new design no longer relates to the blush color. I realized that naming the theme based on color wasn’t the best idea. Next time I need to use a generic name. I’d like to rename the theme. Will renaming the theme folder and updating the theme name in config.toml be sufficient, or will this affect Hugo’s functionality?

I know this might sound a bit trivial, but I’ve made a lot of changes to the template files and added custom CSS. I really don’t want to start over by using the hugo new theme command again.

If your theme is only local in your site that should be all.

Could you clarify what you mean by “only local”? I haven’t deployed it yet, so renaming the theme folder should work, correct?

It’s not complicated, really: If you put your theme up for others to use, it’s no longer “local”. And then changing the name might cause trouble for others.

This is a local theme only.

The short answer is no. I may chime in with a longer answer when I get behind a real pc.

Thank you very much. I’m very grateful. I have this on GitHub, but the template isn’t syncing with the Hugo theme page, it’s something I’m using just for myself. I’m thinking that in the terminal, I should clone the repository and then do a:

$ cd mywebsite
$ cd themes
$ git mv blush newname
$ cd ..
$ git add .
$ git commit -m "Update theme name"
$ git push

Plus, I think I need to edit the hugo.toml file, right?

Correct

Just for clarification:

The Hugo themes page is a place where you can let’s say advertise a theme for the public.

It’s a moderated listing page. The theme is not hosted there. Most themes are hosted in a github repo of the theme author.

Adding a theme there is not a must if you want to provide a theme for others. But a prominent source for users searching for a suitable theme.

Read more about here:

And IMHO if you list it there in you promise a mature state and some sort of support.

1 Like