diff options
author | Darren J. de Lima <darren.delima@yahoo.co.uk> | 2022-07-20 18:08:02 +0300 |
---|---|---|
committer | Darren J. de Lima <darren.delima@yahoo.co.uk> | 2022-07-20 18:08:02 +0300 |
commit | e9b01ab225e1f686704a5d566b1c57d86c48885b (patch) | |
tree | 3794df438f0782ecb9c880d9acfeab1121a389f5 | |
parent | c13f35738af9fa2ff4a17fb11917e5d9c1224425 (diff) |
[Feature] Add custom wallpaper param (not yet adaptive)
Custom wallpaper does not change with site switching to dark mode... but then, the theme does not support dark/light mode switching yet.
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 2 | ||||
-rw-r--r-- | layouts/partials/head.html | 12 |
3 files changed, 16 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3986643..be318e6 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -73,6 +73,9 @@ defaultContentLanguage = "en" # Default language to use photoswipe = true # see https://github.com/dimsemenov/PhotoSwipe # 是否启用PhotoSwipe(图片可点击) contentCopyright = '<a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a>' + # Optional custom wallpaper image URL. Can be a remote image or local /static/img/wallpaper.jpg (make sure it has a small filesize for quick site painting) + wallpaper = "https://followingmyfeet.com/wp-content/uploads/2018/02/825_2229-HDR.jpg" + # Link custom CSS and JS assets # (relative to /static/css and /static/js respectively) customCSS = [] # if ['custom.css'], load '/static/css/custom.css' file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a3df1dc..9efa8bf 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -45,7 +45,7 @@ </header> <div id="mobile-panel"> - <main id="main" class="main bg-llight"> + <main id="main" class="main bg-llight wallpaper"> <div class="content-wrapper"> <div id="content" class="content container"> {{ block "content" . }}{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 3728b97..41fc462 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -78,6 +78,18 @@ <link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" media="screen" crossorigin="anonymous"> <!-- End --> +<!-- Custom wallpaper (optional) --> +{{- if .Site.Params.wallpaper }} +<style> + .wallpaper { + background-image: url('{{ .Site.Params.wallpaper }}'); + background-repeat: no-repeat; + background-attachment: fixed; + background-size: cover; + } +</style> +{{- end }} + <!-- custom css --> {{ range .Site.Params.customCSS }} <link rel="stylesheet" href="{{ "/css/" | relURL }}{{ . }}"> |