diff --git a/layouts/partials/bootstrap/article-cards.html b/layouts/partials/bootstrap/article-cards.html index 374e779..0f5f7c0 100644 --- a/layouts/partials/bootstrap/article-cards.html +++ b/layouts/partials/bootstrap/article-cards.html @@ -1,28 +1,33 @@ {{- $summaryLen := 120 }} {{- $limit := 12 }} {{- $sections := slice }} +{{- $linkText := i18n "read_more" }} {{- if .IsNamedParams }} {{- with .Get "limit" }}{{ $limit = . }}{{ end }} {{- with .Get "summaryLen" }}{{ $summaryLen = . }}{{ end }} {{- with .Get "sections" }}{{ $sections = split . "," }}{{ end }} + {{- if isset .Params "linkText" }}{{ $linkText = .Get "linkText" }}{{ end }} {{- end }} {{- $pages := site.RegularPages }} {{- with $sections }} {{- $pages = where $pages "Section" "in" . }} {{- end }} -
+
{{- range first $limit $pages }} -
-
+ {{- if $linkText }} + {{ print `
` | safeHTML }} + {{- else }} + {{ printf `` .RelPermalink .Title | safeHTML }} + {{- end }} +
{{- with .FirstSection }} - + {{- .Title -}} - + {{- end }} + class="z-1 badge text-bg-secondary position-absolute fw-normal top-0 end-0 me-1 mt-1"> {{- .Date | time.Format ":date_medium" -}} {{- $img := partial "images/functions/page-thumbnail" (dict @@ -41,24 +46,30 @@
{{- end }} -
+ {{- if $linkText }} + {{ print `
` | safeHTML }} + {{- else }} + {{ print "" | safeHTML }} + {{- end }} {{- end }}