added 'Context' parameter to handle relative image paths based on the current page
This commit is contained in:
parent
4699c6465e
commit
8b8510b27b
@ -3,7 +3,7 @@
|
||||
<div class="container">
|
||||
<div class="row justify-center">
|
||||
<div class="md:col-10 lg:col-7 text-center">
|
||||
{{ partial "image" (dict "Src" .Params.image "Alt" .Title "Class" "mx-auto mb-6" "Size" "200x200") }}
|
||||
{{ partial "image" (dict "Src" .Params.image "Context" .Page "Alt" .Title "Class" "mx-auto mb-6" "Size" "200x200") }}
|
||||
<h2 class="h3 mb-6">{{ .Title }}</h2>
|
||||
<div class="content">{{ .Content }}</div>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="lg:col-4 text-center">
|
||||
{{ $image:= .Params.image }}
|
||||
{{ if $image }}
|
||||
{{ partial "image" (dict "Src" $image "Alt" .Title "Class" "mx-auto" "Size" "200x200") }}
|
||||
{{ partial "image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "mx-auto" "Size" "200x200") }}
|
||||
{{ else if .Params.Email }}
|
||||
<img
|
||||
class="mx-auto"
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{ $image:= .Params.image }}
|
||||
{{ if $image }}
|
||||
<div class="mb-10">
|
||||
{{ partial "image" (dict "Src" $image "Alt" .Title "Class" "w-full rounded") }}
|
||||
{{ partial "image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "w-full rounded") }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<h1 class="h2 mb-4">
|
||||
|
@ -2,7 +2,7 @@
|
||||
class="bg-theme-light dark:bg-darkmode-theme-light rounded p-8 text-center">
|
||||
{{ $image:= .Params.image }}
|
||||
{{ if $image }}
|
||||
{{ partial "image" (dict "Src" $image "Alt" .Title "Class" "mx-auto mb-6 rounded" "size" "120x120") }}
|
||||
{{ partial "image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "mx-auto mb-6 rounded" "size" "120x120") }}
|
||||
{{ else if .Params.Email }}
|
||||
<img
|
||||
class="mx-auto mb-6 rounded"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="bg-body dark:bg-darkmode-body">
|
||||
{{ $image:= .Params.image }}
|
||||
{{ if $image }}
|
||||
{{ partial "image" (dict "Src" $image "Alt" .Title "Class" "mb-6 w-full rounded") }}
|
||||
{{ partial "image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "mb-6 w-full rounded") }}
|
||||
{{ end }}
|
||||
<h4 class="mb-3">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
|
Loading…
x
Reference in New Issue
Block a user