From cc1220bfd794dff1fc28bd39cafb63c4b1093cf8 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Appel Date: Mon, 25 Dec 2023 17:17:21 -0500 Subject: rewrite layouts --- layouts/partials/card.html | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 layouts/partials/card.html (limited to 'layouts/partials/card.html') diff --git a/layouts/partials/card.html b/layouts/partials/card.html new file mode 100644 index 0000000..c451066 --- /dev/null +++ b/layouts/partials/card.html @@ -0,0 +1,53 @@ +{{ $cardConfig := .Scratch.Get "cardConfig" }} +
+ +
  • +
    +

    {{ .LinkTitle }}

    +

    {{ partial "card/date.html" . }}

    + {{ if $cardConfig.fullSummary }} + {{ partial "card/full_summary.html" . }} + {{ else }} +

    {{ .Summary }}

    + {{ end }} +
    + + {{ with .Resources.GetMatch .Params.thumbnail }} + {{ $image := .Fit "800x500" }} +
    + {{ .Name }} +
    + {{ else }} + {{ with .Resources.GetMatch "thumbnail.*" }} + {{ $image := .Fit "400x400" }} +
    + {{ $image.Name }} +
    + {{ end }} + {{ end }} +
  • +
    +{{ if $cardConfig.showMeta }} +
    + {{ with .Params.github }} + {{ partial "links/github.html" . }} + {{ end }} + {{ with .Params.link }} + {{ partial "links/link.html" . }} + {{ end }} + {{ with .Params.site }} + {{ partial "links/site.html" . }} + {{ end }} + {{ $hasMetaAttrs := or $cardConfig.showCategories $cardConfig.showTags }} + {{ if $hasMetaAttrs }} +
    + {{ if $cardConfig.showCategories }} + {{ partial "categories.html" . }} + {{ end }} + {{ if $cardConfig.showTags }} + {{ partial "tags.html" . }} + {{ end }} +
    + {{ end }} +{{ end }} +
    -- cgit v1.2.3