Skip to content

Commit

Permalink
feat(article-cards): add the imgPlaceholder parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Sep 19, 2023
1 parent d66590c commit a2d4b77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/partials/bootstrap/article-cards.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
{{- $linkText := i18n "read_more" }}
{{- $itemAttrs := slice }}
{{- $imgHeight := 120 }}
{{- $imgPlaceholder := "NO IMAGE" }}
{{- 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 }}
{{- $itemAttrs = partial "bootstrap/functions/attributes" (dict "Params" .Params "Prefix" "item-attr") }}
{{- with .Get "imgHeight" }}{{ $imgHeight = . }}{{ end }}
{{- with .Get "imgPlaceholder" }}{{ $imgPlaceholder = . }}{{ end }}
{{- end }}
{{- $pages := site.RegularPages }}
{{- with $sections }}
Expand Down Expand Up @@ -48,7 +50,7 @@
<div
class="bg-secondary-subtle d-flex justify-content-center align-items-center h4 user-select-none my-0"
style="height: {{ $imgHeight }}px; filter: blur(1px);">
NO IMAGE
{{ $imgPlaceholder }}
</div>
{{- end }}
<div class="card-body d-flex flex-column p-4">
Expand Down

0 comments on commit a2d4b77

Please sign in to comment.