diff options
author | Julian <julian@vantage-design.com> | 2020-11-26 11:32:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-26 11:32:35 +0300 |
commit | e2ebc35b6b7071c80c167bfa1c3004d7796456f1 (patch) | |
tree | 5571e51552840705b0270a3ca312b49f4fb95e75 | |
parent | f297dc8f723deab04c081ffe0087b16db70e77f1 (diff) | |
parent | a750446c6fe1d3c23f5ee5af542b65ad062da590 (diff) |
Merge pull request #29 from sumpfralle/custom-css
Add custom_css parameter
-rw-r--r-- | exampleSite/content/configuration/_index.md | 12 | ||||
-rw-r--r-- | layouts/partials/head.html | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/exampleSite/content/configuration/_index.md b/exampleSite/content/configuration/_index.md index 244df9b..8eb4f3e 100644 --- a/exampleSite/content/configuration/_index.md +++ b/exampleSite/content/configuration/_index.md @@ -54,3 +54,15 @@ Disable search by setting <code>disableSearch = true</code> in <code>config.toml The local search feature is based on the content of `index.json`, which is generated based on a configurable template. Search results are presented as a drop-down list attached to the search input field while typing. + + +## Custom CSS + +You can override the built-in css by using your own. Just put your own css files in the `static` directory of your website (the one in the theme directory also works but is not recommended) and modify the `custom_css` parameter in your config file. The path referenced in the parameter should be relative to the `static` folder. These css files will be added through the `header` partial after the built-in css file. + +For example, if your css files are `static/css/custom.css` and `static/css/custom2.css` then add the following to the config file: + +``` + [params] + custom_css = ["css/custom.css","css/custom2.css"] +``` diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 1e7e079..1673635 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,6 +17,10 @@ {{ $style := resources.Get "css/ace.scss" | toCSS | minify }} <link rel="stylesheet" href="{{ $style.Permalink }}"> + {{ range .Site.Params.custom_css }} + <link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}"> + {{ end }} + <!-- Only include the tracking when using `hugo` or adding `--environment production` --> {{ if eq hugo.Environment "production" }} {{ template "_internal/google_analytics_async.html" . }} |