Is it possible to only activate a single option / value in a config when the site is served / built locally?

My theme dir structure is simple: the contents of the theme itself are in the repo root and there’s exampleSite as per the documentation.

Now, if you want to set up this theme locally from exampleSite, its config should contain this:

theme: cstate
themesDir: ..

so that it could load from the root.

This works but if you want to copy the exampleSite folder and then add a exampleSite/themes folder with that theme, then that option prevents the theme from loading.

What would be the most logical way to cover this? Have a separate config file, document this behavior, or just ‘take care of it’?

What are you trying to achieve? :slight_smile: I ask because it sounds like a complex setup. What we typically see with Hugo themes is that the theme contains an exampleSite folder that’s used for the theme demo. If you add a new theme to that folder, you’d get an example theme from the theme’s demo.

That’s probably also why themes/mytheme/exampleSite/theme doesn’t load in Hugo, because it’s two themes in one.

I’m definitely not trying to load two themes. In fact, there’s only one. It’s the standard setup, I followed Artist Theme.

This is the source code. It’s a complex theme, a niche one, but it’s got the same principles.