mirror of
https://github.com/foo-dogsquared/hugo-theme-contentful.git
synced 2025-02-07 06:19:02 +00:00
Add easy extension for custom styles
This commit is contained in:
parent
059a6c489c
commit
654a703d3f
@ -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
|
== [2.1.0] - 2020-10-28
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
## License
|
||||||
|
|
||||||
This theme is licensed under MIT license.
|
This theme is licensed under MIT license.
|
||||||
|
0
assets/css/extend.css
Normal file
0
assets/css/extend.css
Normal file
@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
{{- /* Only enable asset bundling in production */ -}}
|
{{- /* Only enable asset bundling in production */ -}}
|
||||||
{{- $style := resources.Get "css/main.css" -}}
|
{{- $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 }}
|
{{- if hugo.IsProduction }}
|
||||||
{{- $style = $style | resources.Minify | resources.Fingerprint -}}
|
{{- $style = $style | resources.Minify | resources.Fingerprint -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user