Skip to content

Commit 144534f

Browse files
committed
turn intro image into a partial, add ability to position intro image, add image for team page
1 parent 03dd730 commit 144534f

File tree

10 files changed

+423
-36
lines changed

10 files changed

+423
-36
lines changed

exampleSite/config.toml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ themesDir = "themes"
33
theme = "hugo-serif-theme"
44
languageCode = "en-us"
55
title = "Hugo Serif Theme"
6-
summaryLength = 10
76

87
[module]
98
[module.hugoVersion]

exampleSite/content/_index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: 'Homepage'
33
meta_title: 'Hugo Serif Theme'
44
description: "Serif is a modern business theme for Hugo."
55
intro_image: "images/illustrations/pointing.svg"
6-
intro_image_absolute: true
6+
intro_image_absolute: true # makes the image use css position: absolute; so it looks "offset". It's a visual effect that might not always look good depending on the image you use.
7+
intro_image_absolute_offset: "auto auto -100px -80px" # used to tweak the positioning of the absolute image if enabled above
78
intro_image_hide_on_mobile: true
89
---
910

exampleSite/content/team/_index.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: 'Team'
3-
# intro_image: "images/smartworks-coworking-cW4lLTavU80-unsplash.jpg"
4-
# intro_image_absolute: false
5-
# intro_image_hide_on_mobile: false
3+
intro_image: "images/illustrations/meditate.svg"
4+
intro_image_absolute: true
5+
intro_image_absolute_offset: "auto auto -148px -102px"
6+
intro_image_hide_on_mobile: false
67
---
78

89
# Meet The Team
910

10-
Our team of qualified accountants can help your business at any stage.
11+
Our team of qualified accountants can help your business at any stage.

exampleSite/static/images/illustrations/meditate.svg

+174
Loading

exampleSite/static/images/illustrations/team.svg

+228
Loading

layouts/_default/list.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77
<div class="col-12 col-md-7 col-lg-6 order-2 order-md-1">
88
{{ .Content }}
99
</div>
10-
{{ if .Params.intro_image }}
11-
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
12-
<img
13-
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
14-
src="{{ .Params.intro_image | relURL }}" />
15-
</div>
16-
{{ end }}
10+
{{ partial "intro-image.html" . }}
1711
</div>
1812
</div>
1913
</div>

layouts/index.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@
1010
{{ partial "call.html" (dict "site" .Site "context" . "show_button" "true") }}
1111
{{ end }}
1212
</div>
13-
{{ if .Params.intro_image }}
14-
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
15-
<img alt={{ .Title }}
16-
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
17-
src="{{ .Params.intro_image | relURL }}" />
18-
</div>
19-
{{ end }}
13+
{{ partial "intro-image.html" . }}
2014
</div>
2115
</div>
2216
</div>

layouts/partials/intro-image.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ if .Params.intro_image }}
2+
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
3+
<img
4+
alt="{{ .Title }}"
5+
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
6+
src="{{ .Params.intro_image | relURL }}"
7+
style="{{ if .Params.intro_image_absolute_offset }}inset: {{ .Params.intro_image_absolute_offset }};{{end}}"
8+
/>
9+
</div>
10+
{{ end }}

layouts/services/list.html

+1-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@
77
<div class="col-12 col-md-7 col-lg-6 order-2 order-md-1">
88
{{ .Content }}
99
</div>
10-
{{ if .Params.intro_image }}
11-
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
12-
<img
13-
alt={{ .Title }}
14-
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
15-
src="{{ .Params.intro_image | relURL }}" />
16-
</div>
17-
{{ end }}
10+
{{ partial "intro-image.html" . }}
1811
</div>
1912
</div>
2013
</div>

layouts/team/list.html

+1-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@
77
<div class="col-12 col-md-7 col-lg-6 order-2 order-md-1">
88
{{ .Content }}
99
</div>
10-
{{ if .Params.intro_image }}
11-
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
12-
<img
13-
alt="{{ .Title }}"
14-
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
15-
src="{{ .Params.intro_image | relURL }}" />
16-
</div>
17-
{{ end }}
10+
{{ partial "intro-image.html" . }}
1811
</div>
1912
</div>
2013
</div>

0 commit comments

Comments
 (0)