feat: add partialCached to helper/image invocation

Using .RelPermalink as key for cache
This commit is contained in:
Jimmy Cai
2020-09-17 21:52:06 +02:00
parent 9a64b7a6f1
commit cf6502c311
8 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
</footer>
</div>
{{ $image := partial "helper/image" (dict "Context" . "Type" "articleList") }}
{{ $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink }}
{{ if $image.exists }}
<div class="article-image">
+1 -1
View File
@@ -1,4 +1,4 @@
{{ $image := partial "helper/image" (dict "Context" . "Type" "articleList") }}
{{ $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink }}
<article class="{{ if $image.exists }}has-image{{ end }}">
{{ if $image.exists }}
<div class="article-image">
+1 -1
View File
@@ -1,4 +1,4 @@
{{ $image := partial "helper/image" (dict "Context" .context "Type" .Type) }}
{{ $image := partialCached "helper/image" (dict "Context" .context "Type" .Type) .context.RelPermalink }}
<article class="{{ if $image.exists }}has-image{{ end }}">
<a href="{{ .context.Permalink }}">