From 35d298ae55c75c810099ca1badfe27cfdcb9441e Mon Sep 17 00:00:00 2001 From: Ay0 Date: Sun, 9 Aug 2020 21:24:24 +0100 Subject: [PATCH] added support for a background image on the homepage --- assets/scss/_main.scss | 7 +++++++ exampleSite/config.toml | 3 +++ layouts/_default/baseof.html | 2 ++ layouts/index.html | 6 ++++++ 4 files changed, 18 insertions(+) diff --git a/assets/scss/_main.scss b/assets/scss/_main.scss index f568cc5..580af77 100644 --- a/assets/scss/_main.scss +++ b/assets/scss/_main.scss @@ -330,3 +330,10 @@ hr { text-decoration: none; z-index: 100000; } + +.background-image { + background-repeat: no-repeat; + background-attachment: fixed; + background-size: cover; + background-position: center center; +} \ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index da7a50f..07c2c40 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -60,6 +60,9 @@ disableHugoGeneratorInject = false homeSubtitle = "Hello Friend NG" + # Set a background for the homepage + # background_image = "assets/images/background.jpg" + # Prefix of link to the git commit detail page. GitInfo must be enabled. # gitUrl = "" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 007539e..ec42a61 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,7 +4,9 @@ {{ partial "head.html" . }} + {{ block "body" . }} + {{ end }}
{{ partial "header.html" . }} diff --git a/layouts/index.html b/layouts/index.html index 574c689..b7ee112 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,3 +1,9 @@ +{{ define "body" }} + +{{ end }} + {{ define "main" }}