Add easy extension for custom styles

This commit is contained in:
Gabriel Arazas 2020-10-30 02:43:39 +08:00
parent 059a6c489c
commit 654a703d3f
4 changed files with 29 additions and 0 deletions

View File

@ -7,6 +7,16 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version
== [Unreleased]
=== Added
* A custom empty CSS file (`assets/css/extend.css`) for easy customization of the styling.
== [2.1.0] - 2020-10-28

View File

@ -205,6 +205,15 @@ This theme is inspired by the following beautiful and minimal pieces of work:
## Frequently asked questions
- How to extend with custom styling?
- Simply create `assets/css/extend.css` and you're on your merry way.
This will be concatenated with the main stylesheet so it will still be in one file.
## License
This theme is licensed under MIT license.

0
assets/css/extend.css Normal file
View File

View File

@ -2,6 +2,16 @@
{{- /* Only enable asset bundling in production */ -}}
{{- $style := resources.Get "css/main.css" -}}
{{- /* The custom stylesheet. */ -}}
{{- $custom_styles := resources.Get "css/extend.css" -}}
{{- /*
The order is important since CSS needs orders.
Which means the custom stylesheet should be the last to be concatenated.
*/ -}}
{{- $style = slice $style $custom_styles | resources.Concat "css/index.css" -}}
{{- if hugo.IsProduction }}
{{- $style = $style | resources.Minify | resources.Fingerprint -}}
{{- end }}