From ffd9ef94479954a8e7ba0e9f1ebed9e8ce7727b1 Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Wed, 12 Feb 2025 20:02:51 +0000 Subject: [PATCH] Add Schema.org itemprops Also re-enables openlibrary parsing. --- content/notes/yzeto.md | 1 - layouts/partials/film.html | 8 ++++---- layouts/partials/openlibrary.obj | 4 ---- layouts/shortcodes/book.html | 14 +++++++------- layouts/shortcodes/music.html | 14 +++++++------- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/content/notes/yzeto.md b/content/notes/yzeto.md index 1bd78339..e6e3836a 100644 --- a/content/notes/yzeto.md +++ b/content/notes/yzeto.md @@ -3,7 +3,6 @@ title: Peach (by salute) is my jam type: like date: 2024-03-07T10:17:40.792Z publishDate: 2024-03-07T10:17:40.792Z -references: {} tags: - ThisIsMyJam - music diff --git a/layouts/partials/film.html b/layouts/partials/film.html index 5ea43bfd..ec0c5a68 100644 --- a/layouts/partials/film.html +++ b/layouts/partials/film.html @@ -1,12 +1,12 @@ -
- +
+
- {{ .title }} ({{ .year }}) + ()
diff --git a/layouts/partials/openlibrary.obj b/layouts/partials/openlibrary.obj index 1d42296a..751fcb31 100644 --- a/layouts/partials/openlibrary.obj +++ b/layouts/partials/openlibrary.obj @@ -1,6 +1,3 @@ -{{/* Return empty object while OpenLibrary is down. I need something more robust here! */}} -{{ return dict }} -{{/* {{- $path := .path -}} {{- $isbn := "" -}} {{- $key := "" -}} @@ -85,4 +82,3 @@ {{- end -}} {{- end -}} {{- return $book -}} -*/}} \ No newline at end of file diff --git a/layouts/shortcodes/book.html b/layouts/shortcodes/book.html index ac7d8e3f..5587eb66 100644 --- a/layouts/shortcodes/book.html +++ b/layouts/shortcodes/book.html @@ -1,11 +1,11 @@ {{- define "partials/author-list.html" -}} {{- $authors := . -}} {{- if and (ne $authors nil) (gt (len $authors) 0) -}} - + @@ -16,21 +16,21 @@ {{- $book := partial "openlibrary.obj" (dict "path" .Page.Path "id" (.Get 0)) -}} {{- with $book -}} {{- if and $showCover .cover -}} -
- +
+
- {{ .title }} + {{- partial "partials/author-list.html" .authors -}}
{{- else -}} - {{ .title }} + {{ .title }} {{- partial "partials/author-list.html" .authors -}} {{- end -}} {{- end -}} diff --git a/layouts/shortcodes/music.html b/layouts/shortcodes/music.html index 199a5440..854073b1 100644 --- a/layouts/shortcodes/music.html +++ b/layouts/shortcodes/music.html @@ -9,14 +9,14 @@ {{- range .links -}} {{- $u := urls.Parse . -}} - {{- if eq $u.Hostname "sopen.spotify.com" -}} + {{- if eq $u.Hostname "open.spotify.com" -}} {{- $klass = "spotify" -}} - {{- $embed = printf "" $u.Path -}} + {{- $embed = printf "" $u.Path -}} {{- break -}} - {{- else if eq $u.Hostname "smusic.apple.com" -}} + {{- else if eq $u.Hostname "music.apple.com" -}} {{- $klass = "apple-music" -}} - {{- $embed = printf "" $u.Path -}} + {{- $embed = printf "" $u.Path -}} {{- break -}} {{- else if and (eq $u.Hostname "soundcloud.com") (isset $data "soundcloudtrackid") -}} @@ -28,11 +28,11 @@ {{- end -}} -
+
{{ $embed | safeHTML }}
- 🎶 {{ $displayArtist }}{{ with $displayTitle }}{{ if $displayArtist }}: {{ end }}{{ . }}{{ end }}
- {{ with $musicbrainz }}Listen elsewhere{{ end }} + 🎶 {{ $displayArtist }}{{ with $displayTitle }}{{ if $displayArtist }}: {{ end }}{{ . }}{{ end }}
+ {{ with $musicbrainz }}{{ end }}
{{- else -}}