From 654a703d3fe40aa3becf68dd62cf876bab6852f1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 30 Oct 2020 02:43:39 +0800 Subject: [PATCH] Add easy extension for custom styles --- CHANGELOG.adoc | 10 ++++++++++ README.md | 9 +++++++++ assets/css/extend.css | 0 layouts/partials/head.html | 10 ++++++++++ 4 files changed, 29 insertions(+) create mode 100644 assets/css/extend.css diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 752acd1..85ac88e 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -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 diff --git a/README.md b/README.md index eac778c..f61b07b 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/assets/css/extend.css b/assets/css/extend.css new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 5a05c9e..5995924 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -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 }}