diff options
author | Humberto Rocha <humrochagf@gmail.com> | 2020-10-30 16:25:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 16:25:16 +0300 |
commit | 16f9e3600849923ef3e0c15ba78a0a128ca7a2b9 (patch) | |
tree | e2c391aee1b80f770bbc6b37b5d8103574112549 | |
parent | a57ff5613785e13ee8a76933d2987529c8d5dd0e (diff) | |
parent | fa78a0060b2e4fe9b4d3046410e7f3551890362a (diff) |
Merge pull request #2 from chris-asl/allow-custom-css
support custom CSS files
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 3 |
2 files changed, 12 insertions, 0 deletions
@@ -24,6 +24,15 @@ params: siteLogo: "logo-photo.png" ``` +## Custom CSS + +You can load your custom CSS files by adding them under the `static` folder, e.g. `static/css/custom.css` and then defining the parameters: + +```yaml +params: + custom_css: "css/custom.css" +``` + ## Website Example You check [my blog](https://humberto.io) to see the theme fully running. diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8fffebc..a465426 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -12,6 +12,9 @@ <!-- styles --> {{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "style.main.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }} <link rel="stylesheet" href="{{ $style.Permalink }}"> + {{ range .Site.Params.custom_css -}} + <link rel="stylesheet" href="{{ . | absURL }}"> + {{- end }} {{ block "headAdditional" . }} {{ end }} |