Advanced Usage
Discover advanced usage of the Hugo - FixIt theme.
Style Customization
FixIt theme has been built to be as configurable as possible by defining custom .scss
style files.
The directory including the custom .scss
style files is assets/css
relative to your project root directory.
In assets/css/_override.scss
, you can override the variables in themes/FixIt/assets/css/_variables.scss
to customize the style.
Here is a example:
|
|
In assets/css/_custom.scss
, you can add some css style code to customize the style.
Page Style
The FixIt theme provides a page width configuration option pageStyle
and three values.
- narrow Keep
<v0.2.13
page/toc width ratio - normal New default page/toc width ratio
- wide Larger page/toc width ratio
In addition, you can also customize the pageStyle
value in assets/css/_custom.scss
For example: pageStyle="custom"
|
|
Print Style
There are three css common class for print view in FixIt Theme.
page-break-before
Insert page break before elementpage-break-after
Insert page break after elementprint-d-none
Hide elements in print view
Here is a simple exmple:
|
|
If you set goldmark.parser.attribute.block
to true
, you can also use:
|
|
Script Customization
The directory including the custom script file named custom.js
is assets/js
relative to your project root directory.
If the script file assets/js/custom.js
exists, it will be executed at the end of each post and page.
Templates Customization
Hugo allows you to modify the theme by overriding the theme templates, for example: you can create layouts/404.html
file to override themes/FixIt/layouts/404.html
, so as to meet the needs of custom 404 page template of FixIt theme.
However, for most of the templates, FixIt theme generally doesn’t recommend you do this, as it may make theme upgrades difficult in the future.
In order to avoid upgrade conflicts, based on this feature, the FixIt theme opens several empty templates in commonly used locations for user customization, see params.customFilePath
parameter in theme configuration.
For example, the FixIt theme documentation site customizes the profile section of the home page by creating layouts/partials/custom/profile.html
.
First enable custom file path parameter:
|
|
then, customize the template:
|
|
PWA Support
This part is shown in the pwa support page.