fix: add .Type as second cache key for helper/image

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/12
This commit is contained in:
Jimmy Cai
2020-09-18 00:12:26 +02:00
parent c74cc3e4b3
commit 93146c9dc3
10 changed files with 10 additions and 12 deletions
+1 -2
View File
@@ -12,8 +12,7 @@
</footer>
</div>
{{ $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink }}
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}}
{{ if $image.exists }}
<div class="article-image">
{{ if $image.resource }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{ $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink }}
{{ $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" }}
<article class="{{ if $image.exists }}has-image{{ end }}">
{{ if $image.exists }}
<div class="article-image">
+1 -1
View File
@@ -1,4 +1,4 @@
{{ $image := partialCached "helper/image" (dict "Context" .context "Type" .Type) .context.RelPermalink }}
{{ $image := partialCached "helper/image" (dict "Context" .context "Type" .Type) .context.RelPermalink .Type }}
<article class="{{ if $image.exists }}has-image{{ end }}">
<a href="{{ .context.Permalink }}">