Skip to content

Commit

Permalink
Added option to add image (e.g. portrait) on front page
Browse files Browse the repository at this point in the history
  • Loading branch information
softcat committed May 13, 2020
1 parent c3bf34a commit aba0ed2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions assets/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ img {
&.right {
margin-left: auto;
}
&.circle {
border-radius: 50%;
max-width: 25%;
margin: auto;
}
}

figure {
Expand Down
4 changes: 4 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down

0 comments on commit aba0ed2

Please sign in to comment.