add 'cards' shortcode; + minor fixes and improvements

This commit is contained in:
Helmut Merz 2024-11-04 09:16:34 +01:00
parent 438cdd54e0
commit 5326e4f7b4
4 changed files with 15 additions and 10 deletions

View file

@ -12,9 +12,9 @@
itemscope itemtype="http://schema.org/BlogPosting">
{{- partial "content" . -}}
{{- if eq $showChildren "embed" -}}
{{ range sort (sort $children "Date" "desc") "Weight" }}
{{ partial "embed" . }}
{{ end }}
{{- range sort (sort $children "Date" "desc") "Weight" }}
{{ partial "embed" . -}}
{{- end -}}
{{- end -}}
</article>
</div>
@ -25,9 +25,9 @@
{{- if hasPrefix $showChildren "card" -}}
<div class="row">
{{ range sort (sort $children "Date" "desc") "Weight" }}
{{ partial "card" . }}
{{ end }}
{{- range sort (sort $children "Date" "desc") "Weight" }}
{{ partial "card" . -}}
{{- end -}}
</div>
{{- end }}

View file

@ -29,10 +29,9 @@
src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}"
alt="{{ .Site.Title }}">
{{- end }}
<div class="card-body">
<span class="card-title h4">{{ .Title | truncate 30 }}</span>
{{ if and (not .Params.nodate) .Date -}}
{{- if and (not .Params.nodate) .Date -}}
<span class="post-meta pull-right">
<small>{{ .Date.Format (i18n "dateFormat") }}</small></span>
{{- end }}

View file

@ -0,0 +1,7 @@
<div class="row">
{{- range split .Inner " " -}}
{{- range where $.Site.Pages "Params.pageid" "eq" . }}
{{ partial "card" . -}}
{{- end -}}
{{- end -}}
</div>

View file

@ -9,8 +9,7 @@
{{- $anchor := printf "link-%d" $linkid -}}
{{- range $pages -}}
{{- if ne $title "none" -}}
### [{{ or $title .Title }}]({{ .Permalink }}) {#{{ $anchor }}}
{{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this "btext" $btext "btitle" $btitle)) -}}
### [{{ or $title .Title }}]({{ .Permalink }})
{{- end -}}
{{ .RenderShortcodes }}
{{- end -}}