From 63c129272603dace55ff05e85adb10aa0df4e0cf Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Mon, 1 Apr 2024 12:14:49 +0100 Subject: [PATCH] Add new post types in SVG --- config.toml | 6 ++++-- layouts/partials/post-previews.html | 9 +++++---- layouts/partials/{post-type.html => post-type.txt} | 0 layouts/partials/svg.html | 2 ++ 4 files changed, 11 insertions(+), 6 deletions(-) rename layouts/partials/{post-type.html => post-type.txt} (100%) diff --git a/config.toml b/config.toml index c8f86403..480c043c 100644 --- a/config.toml +++ b/config.toml @@ -65,10 +65,12 @@ date = ["date", "publishDate", "lastmod", ":git"] poetry = "🥁" [params.defaultSVG] - posts = "document" + post = "document" bookmarks = "bookmark" + article-bookmark = "bookmark" + video-bookmark = "video" notes = "message" - photos = "camera" + photo = "camera" calendar = "calendar" review = "review" poetry = "feather" diff --git a/layouts/partials/post-previews.html b/layouts/partials/post-previews.html index 7ce9d0d7..3a2e315b 100644 --- a/layouts/partials/post-previews.html +++ b/layouts/partials/post-previews.html @@ -6,7 +6,8 @@
    {{- $posts := where .Site.RegularPages "Section" "in" (slice "posts" "bookmarks" "poetry") -}} {{- range $posts.ByPublishDate.Reverse | first 6 -}} - {{- $typeSVG := index .Site.Params.defaultSVG .Type -}} + {{- $postType := partial "post-type.txt" . -}} + {{- $typeSVG := index .Site.Params.defaultSVG ( partial "kebab.txt" $postType) -}}
  1. {{ partial "svg.html" (dict "name" $typeSVG) }} @@ -14,7 +15,7 @@
    - {{- partial "post-type.html" . }} + {{ $postType }} {{ partial "year-relative-date.html" .Date }}
    @@ -53,7 +54,7 @@ {{- $picPage := index (where .Site.RegularPages "Section" "eq" "photos") 0 -}} {{- with $picPage -}}
    -
    Photo {{ partial "svg.html" (dict "name" "camera") }} {{ partial "year-relative-date.html" .Date }}
    +
    {{ partial "svg.html" (dict "name" "camera") }} {{ partial "year-relative-date.html" .Date }}
    {{- $src := index $picPage.Params.Media 0 -}} @@ -68,7 +69,7 @@ {{- $notePage := index (where .Site.RegularPages "Section" "eq" "notes") 0 -}} {{- with $notePage -}}
    -
    Note {{ partial "svg.html" (dict "name" "message") }} + diff --git a/layouts/partials/post-type.html b/layouts/partials/post-type.txt similarity index 100% rename from layouts/partials/post-type.html rename to layouts/partials/post-type.txt diff --git a/layouts/partials/svg.html b/layouts/partials/svg.html index c8ba89d9..9cefb5b3 100644 --- a/layouts/partials/svg.html +++ b/layouts/partials/svg.html @@ -184,6 +184,8 @@ {{- else if (eq .name "unsplash") -}} +{{- else if (eq .name "video") -}} + {{- else if (eq .name "whatsapp") }} {{- else if (eq .name "xampp") -}}