added support for a background image on the homepage

This commit is contained in:
Ay0 2020-08-09 21:24:24 +01:00
parent 6fa58f635e
commit 35d298ae55
4 changed files with 18 additions and 0 deletions

View file

@ -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;
}

View file

@ -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 = ""

View file

@ -4,7 +4,9 @@
{{ partial "head.html" . }}
</head>
{{ block "body" . }}
<body class="{{ if ne $.Site.Params.defaultTheme "light" -}} dark-theme {{- end -}}">
{{ end }}
<div class="container">
{{ partial "header.html" . }}

View file

@ -1,3 +1,9 @@
{{ define "body" }}
<body
class="{{ if ne $.Site.Params.defaultTheme "light" -}} dark-theme {{- end -}} {{ if .Site.Params.background_image }}background-image"
style="background-image: url('{{ .Site.Params.background_image }}');" {{ else }}"{{ end }}>
{{ end }}
{{ define "main" }}
<main aria-role="main">
<div>