Passes those values, plus baseURL, to Sass as variables. Hugo's "ExecuteAsTemplate" option only works on the primary Sass file, not partials (ref here and here), so these are defined in main.sass. This means these variables are also available to end-users in their _override.s{a|c}ss and _custom.s{a|c}ss files!
Uses the Sass variables in the partials to define paths to fonts and images, including the subheader-permalink icon, which is moved from JS to Sass to make it easier to override for end-users. (Otherwise they'd have to override the entire JS function just to change the image.)
Testing this PR
Try using the theme with a site address containing a subdirectory (e.g. hugo server --baseURL http://localhost:1313/foo/)
Try using the theme with a site address at a root domain (e.g. hugo server)
In each, check:
The ability to perform searches
The presence of the light/dark mode switch icons
The presence of the correct custom fonts
On the "Markdown Syntax Guide" post, ensure that
all images load
the permalink icon (chain link) appears when hovering over subheadings
the icons appear in the code block when hovering (copy, number, etc.)
Optionally open a web debug console and see if any file references are returning 404s
Checklist
Ensure you have checked off the following before submitting your PR.
This PR...
Changes / fixes
Changes:
parentURL
androotURL
variables in JS withbaseURL
derived from Hugo config (in a config file or at the command line with--baseURL
)index.json
coming from search. I'm not sure why this was failing when changing therootURL
/baseURL
value before, but simply concatenating the values seems to work.images
with the configurable image directory in the image-related layout partials.Adds:
imagesDir
,fontsDir
andiconsDir
variables and normalizes the names.baseURL
, to Sass as variables. Hugo's "ExecuteAsTemplate" option only works on the primary Sass file, not partials (ref here and here), so these are defined inmain.sass
. This means these variables are also available to end-users in their_override.s{a|c}ss
and_custom.s{a|c}ss
files!Testing this PR
hugo server --baseURL http://localhost:1313/foo/
)hugo server
)In each, check:
Checklist
Ensure you have checked off the following before submitting your PR.