From eeb97d35810b40d10133c054b670a42f6a55e58f Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Sun, 31 Mar 2024 23:41:15 +0100 Subject: [PATCH] Fix a URL --- content/bookmarks/playable-quotes.md | 2 +- layouts/partials/bookmark-of.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/content/bookmarks/playable-quotes.md b/content/bookmarks/playable-quotes.md index 7da30892..f81f0d33 100644 --- a/content/bookmarks/playable-quotes.md +++ b/content/bookmarks/playable-quotes.md @@ -6,7 +6,7 @@ category: - games - emulation - web -bookmarkOf: https://tenmile.quote.games/ +bookmarkOf: https://tenmile.quote.games references: bookmark: url: https://tenmile.quote.games diff --git a/layouts/partials/bookmark-of.html b/layouts/partials/bookmark-of.html index 8ed1c2e1..4e6469d0 100644 --- a/layouts/partials/bookmark-of.html +++ b/layouts/partials/bookmark-of.html @@ -11,10 +11,11 @@ {{- $page := . -}} {{- $url := .Params.bookmarkOf -}} +{{- $hostname := ($url | urls.Parse).Hostname -}} {{- $reference := partial "reference.obj" (dict "url" $url "page" $page) -}} {{ partial "svg.html" (dict "name" "message") }} Thoughts on{{" "}} {{- with $reference.name -}} 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) }} + {{ partial "rich-link.html" (dict "Class" "u-bookmark-of" "Destination" $url "Text" (printf "an article from %s" $hostname) "Page" $page) }} {{- end }}