diff options
author | Track3 <pengliabc@live.cn> | 2018-11-22 16:33:07 +0300 |
---|---|---|
committer | Track3 <pengliabc@live.cn> | 2018-11-22 16:33:07 +0300 |
commit | e594f1a4948f6344f8353faac035721878d5cddf (patch) | |
tree | 06677e2ddeb88a4a317b90f1cfc387364a68d09e | |
parent | 0a0ee1a1c7e99f40445e0955862d42f1c7a59a09 (diff) |
Add homepage background image
See #2
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/index.html | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 24c94bf..26e7680 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -32,6 +32,7 @@ copyright = "This work is licensed under a Creative Commons Attribution-NonComme footerCopyright = ' · <a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener">CC BY-NC 4.0</a>' # gitUrl = "https://github.com/Someone/SomeRepo/commit/" # Prefix of link to you git commit detail page. GitInfo must be enabled. justifyContent = false # Set "text-align: justify" to .content + # bgImg = "" # Homepage background-image URL [[params.social]] name = "twitter" diff --git a/layouts/index.html b/layouts/index.html index 702c2c4..c36f3d3 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,4 +1,7 @@ {{ define "main" }} + {{- with .Site.Params.bgImg }} + <div class="bg-img" style="background-image: url('{{ . }}')"></div> + {{- end }} <div id="spotlight" class="animated fadeIn"> <div id="home-center"> <h1 id="home-title">{{ .Site.Title }}</h1> |