diff --git a/layouts/partials/hb/modules/blog/post/card.html b/layouts/partials/hb/modules/blog/post/card.html index c61f8d56..f1286b4b 100644 --- a/layouts/partials/hb/modules/blog/post/card.html +++ b/layouts/partials/hb/modules/blog/post/card.html @@ -65,25 +65,8 @@ {{- end }} {{- if $showSummary }} - {{- $summary := $page.Summary }} - {{- $truncated := $page.Truncated }} - {{- with $page.Description }} - {{- $summary = . }} - {{- $truncated := true }} - {{- end }} -
- {{- $summary -}} -
- {{- if and $readMore $truncated }} -
- - {{- i18n "read_more_about" $page.Title -}} - -
- {{- end }} + {{- $summaryCtx := dict "Page" $page "ReadMore" $readMore "External" $external "URL" $url }} + {{ partialCached "hb/modules/blog/post/summary" $summaryCtx $summaryCtx }} {{- end }} {{- if and $thumbnail (ne $thumbnailPos "top") }} diff --git a/layouts/partials/hb/modules/blog/post/summary.html b/layouts/partials/hb/modules/blog/post/summary.html new file mode 100644 index 00000000..95bdcd7c --- /dev/null +++ b/layouts/partials/hb/modules/blog/post/summary.html @@ -0,0 +1,19 @@ +{{- $summary := .Page.Summary }} +{{- $truncated := .Page.Truncated }} +{{- with .Page.Description }} + {{- $summary = . }} + {{- $truncated := true }} +{{- end }} +
+ {{- $summary -}} +
+{{- if and .ReadMore $truncated }} +
+ + {{- i18n "read_more_about" .Page.Title -}} + +
+{{- end }}