ojroques / hugo-researcher

A simple resume theme for Hugo
GNU General Public License v3.0
229 stars 130 forks source link

Configuring variables in variables.scss #13

Closed Sbozzolo closed 3 years ago

Sbozzolo commented 3 years ago

I am playing with the theme and I'd like to tweak the options defined in variables.scss. Is there a way to do this without editing the file (but changing the options in the config.toml)?

ojroques commented 3 years ago

Hello!

Unfortunately this is not well-supported by Hugo. I found hacks that involve including CSS in HTML but I'm not willing to go that way. Feel free to fork the theme if you want to change a variable though :)

(linked to #7)

Sbozzolo commented 3 years ago

Thanks for your response. I think that this is an important feature to have: maintaining a fork costs time and energy and it seems an overkill to fork the theme just to change one variable.

I don't know anything about web development, so maybe what I am saying is an heresy, but it looks like that it is possible to configure .scss files from the config.toml. For example, a quick google search brought me to this link https://pakstech.com/blog/hugo-sass/ where it seems that this is achieved (but again, most of the text is incomprehensible to me).

ojroques commented 3 years ago

Ah yes that seems promising. I'll take a look when I have time. Thanks :)

Sbozzolo commented 3 years ago

Thank you very much!

Another link I found is this: https://regisphilibert.com/blog/2018/07/hugo-pipes-and-asset-processing-pipeline/

This should implement the indented behavior and they have an example for a main.scss:

$backgroundColor: {{ .Param "style.backgroundColor" }};
$textColor: {{ .Param "style.textColor" }};
@import "header";

Which would allow you to configure the various properties via config file.

ojroques commented 3 years ago

I've added support for customizing style from the site config. Thanks again for your articles they were very helpful :)