Merge pull request #155 from softcat/h-f-ng-portrait

Added option to add image (e.g. portrait) on front page
This commit is contained in:
Djordje Atlialp 2020-05-14 23:49:29 +02:00 committed by GitHub
commit d702f5fde0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View file

@ -100,6 +100,11 @@ img {
&.right {
margin-left: auto;
}
&.circle {
border-radius: 50%;
max-width: 25%;
margin: auto;
}
}
figure {

View file

@ -98,6 +98,10 @@ disableHugoGeneratorInject = false
# Set to a valid CSS time value to change the animation duration, "0s" to disable.
# logoCursorAnimate = "2s"
[params.portrait]
path = "/img/image.jpg"
alt = "Portrait"
# Social icons
[[params.social]]
name = "twitter"

View file

@ -1,8 +1,11 @@
{{ define "main" }}
<main aria-role="main">
<div>
<h1>{{ .Site.Title }}</h1>
{{ if .Site.Params.portrait.path }}
<img src="{{ .Site.Params.portrait.path }}" class="circle" alt="{{ .Site.Params.portrait.alt }}" />
{{ end }}
<h1>{{ .Site.Title }}</h1>
{{- with .Site.Params.homeSubtitle }}
<p>{{.}}</p>
{{- end }}