From 4c0e0be6bc607e070095790a0138e77380a6c572 Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Fri, 15 Mar 2024 15:23:22 +0000 Subject: [PATCH] Swap type of bookmark out, when needed --- content/bookmarks/accent-marks-in-english/index.md | 2 +- layouts/partials/bookmark-of.html | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/content/bookmarks/accent-marks-in-english/index.md b/content/bookmarks/accent-marks-in-english/index.md index 755e09c0..562514b8 100644 --- a/content/bookmarks/accent-marks-in-english/index.md +++ b/content/bookmarks/accent-marks-in-english/index.md @@ -7,7 +7,7 @@ bookmarkOf: https://www.youtube.com/watch?v=0Fok5AQ2WRo references: https://wwwYoutubeCom/watch?v=0Fok5Aq2wRo: url: https://www.youtube.com/watch?v=0Fok5AQ2WRo - type: cite + type: video name: Why E̱NGLISH shoul̆d start ūsing accėnt màrks summary: "English generally only uses accent marks for words borrowed from other languages. However, using them more widely could solve many of the spelling and pronunciation problems with our language. In this video, I recommend six accents - or diacritical marks - that we should adopt." featured: https://i.ytimg.com/vi/0Fok5AQ2WRo/maxresdefault.jpg diff --git a/layouts/partials/bookmark-of.html b/layouts/partials/bookmark-of.html index 34af5e3e..38614138 100644 --- a/layouts/partials/bookmark-of.html +++ b/layouts/partials/bookmark-of.html @@ -1,6 +1,13 @@ {{- if not .Params.bookmarkOf -}} {{ errorf "BookmarkOf partial called when no bookmark of param set" -}} {{- end -}} +{{- define "partials/article-type.html" -}} + {{- if collections.In (slice "cite" "entry") . -}} + {{- "article" -}} + {{- else -}} + {{- . -}} + {{- end -}} +{{- end -}} {{- $page := . -}} {{- $url := .Params.bookmarkOf -}} @@ -12,7 +19,7 @@ {{- end -}} 💭 Thoughts on{{" "}} {{- with $reference.name -}} - the article {{ partial "rich-link.html" (dict "Class" "u-bookmark-of" "Destination" $url "Text" . "Page" $page) }}. + the {{ partial "partials/article-type.html" (default "article" $reference.type) }} {{ partial "rich-link.html" (dict "Class" "u-bookmark-of" "Destination" $url "Text" . "Page" $page) }}. {{- else -}} {{ partial "rich-link.html" (dict "Class" "u-bookmark-of" "Destination" $url "Text" (printf "an article from %s" (($url | urls.Parse).Hostname)) "Page" $page) }} {{- end }}