Set config parameters from a theme - is that possible?

I’m busy making my theme Hugo submission-compliant.

My theme relies on pygmentsUseClasses = true et al. The test project doesn’t, and so inline styling is applied. As a result, the appearance is a bit ugly (text intended for dark background is displayed on light one). I’ve tried to copy my config parameters to theme.toml, but it didn’t help.

Is it possible to pass configuration parameters from a theme? Since a theme is supposed to define the appearance, that should make sense.

The alternative is to instruct the user to configure the project accordingly.

What are the “best practices” here?

I had a similar problem some time ago (and had a hard time trying to explain), here is the topic (How do I get the noClasses value?). Also, check this (Can I get the Goldmark config value?) and this (How to use pygmentsUseClasses in HTML?).

AFAIK, there’s no way and you’ll have to instruct the user.

1 Like