Skip to content

Commit

Permalink
turn intro image into a partial, add ability to position intro image,…
Browse files Browse the repository at this point in the history
… add image for team page
  • Loading branch information
JugglerX committed Nov 26, 2023
1 parent 03dd730 commit 144534f
Show file tree
Hide file tree
Showing 10 changed files with 423 additions and 36 deletions.
1 change: 0 additions & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ themesDir = "themes"
theme = "hugo-serif-theme"
languageCode = "en-us"
title = "Hugo Serif Theme"
summaryLength = 10

[module]
[module.hugoVersion]
Expand Down
3 changes: 2 additions & 1 deletion exampleSite/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ title: 'Homepage'
meta_title: 'Hugo Serif Theme'
description: "Serif is a modern business theme for Hugo."
intro_image: "images/illustrations/pointing.svg"
intro_image_absolute: true
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.
intro_image_absolute_offset: "auto auto -100px -80px" # used to tweak the positioning of the absolute image if enabled above
intro_image_hide_on_mobile: true
---

Expand Down
9 changes: 5 additions & 4 deletions exampleSite/content/team/_index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: 'Team'
# intro_image: "images/smartworks-coworking-cW4lLTavU80-unsplash.jpg"
# intro_image_absolute: false
# intro_image_hide_on_mobile: false
intro_image: "images/illustrations/meditate.svg"
intro_image_absolute: true
intro_image_absolute_offset: "auto auto -148px -102px"
intro_image_hide_on_mobile: false
---

# Meet The Team

Our team of qualified accountants can help your business at any stage.
Our team of qualified accountants can help your business at any stage.
174 changes: 174 additions & 0 deletions exampleSite/static/images/illustrations/meditate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
228 changes: 228 additions & 0 deletions exampleSite/static/images/illustrations/team.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 1 addition & 7 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
<div class="col-12 col-md-7 col-lg-6 order-2 order-md-1">
{{ .Content }}
</div>
{{ if .Params.intro_image }}
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
<img
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
src="{{ .Params.intro_image | relURL }}" />
</div>
{{ end }}
{{ partial "intro-image.html" . }}
</div>
</div>
</div>
Expand Down
8 changes: 1 addition & 7 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@
{{ partial "call.html" (dict "site" .Site "context" . "show_button" "true") }}
{{ end }}
</div>
{{ if .Params.intro_image }}
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
<img alt={{ .Title }}
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
src="{{ .Params.intro_image | relURL }}" />
</div>
{{ end }}
{{ partial "intro-image.html" . }}
</div>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions layouts/partials/intro-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ if .Params.intro_image }}
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
<img
alt="{{ .Title }}"
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
src="{{ .Params.intro_image | relURL }}"
style="{{ if .Params.intro_image_absolute_offset }}inset: {{ .Params.intro_image_absolute_offset }};{{end}}"
/>
</div>
{{ end }}
9 changes: 1 addition & 8 deletions layouts/services/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
<div class="col-12 col-md-7 col-lg-6 order-2 order-md-1">
{{ .Content }}
</div>
{{ if .Params.intro_image }}
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
<img
alt={{ .Title }}
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
src="{{ .Params.intro_image | relURL }}" />
</div>
{{ end }}
{{ partial "intro-image.html" . }}
</div>
</div>
</div>
Expand Down
9 changes: 1 addition & 8 deletions layouts/team/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
<div class="col-12 col-md-7 col-lg-6 order-2 order-md-1">
{{ .Content }}
</div>
{{ if .Params.intro_image }}
<div class="col-12 col-md-5 col-lg-6 order-1 order-md-2 position-relative">
<img
alt="{{ .Title }}"
class="intro-image{{ if .Params.intro_image_absolute }} intro-image-absolute{{ end }}{{ if .Params.intro_image_hide_on_mobile }} intro-image-hide-mobile{{ end }}"
src="{{ .Params.intro_image | relURL }}" />
</div>
{{ end }}
{{ partial "intro-image.html" . }}
</div>
</div>
</div>
Expand Down

0 comments on commit 144534f

Please sign in to comment.