From 9589c224ccb74c26974252cf1e9c1ca7b5584aac Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Mon, 21 Oct 2024 11:51:54 +0100 Subject: [PATCH] Fix Gemini Music references --- layouts/shortcodes/music.gmi | 7 +++++++ todo.md | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/music.gmi diff --git a/layouts/shortcodes/music.gmi b/layouts/shortcodes/music.gmi new file mode 100644 index 00000000..aa23d2a2 --- /dev/null +++ b/layouts/shortcodes/music.gmi @@ -0,0 +1,7 @@ +{{- $data := (index site.Data.music.musicbrainz (.Get 0)) -}} +{{- with $data -}} +{{- $displayArtist := .composer | default .artist -}} +{{- $displayTitle := .title | default .album -}} + +=> {{ .musicbrainz }} 🎵 {{ $displayArtist }}{{ with $displayTitle }}{{ if $displayArtist }}: {{ end }}{{ . }}{{ end }} +{{ end -}} diff --git a/todo.md b/todo.md index c527af76..9931457b 100644 --- a/todo.md +++ b/todo.md @@ -30,7 +30,7 @@ Things I might work on within my personal blog's software. - [ ] Import Facebook posts - [ ] Songwhip is dead 😭 replace with something else - [x] Approach complete. Use Musicbrainz - - Annoyingly soundcloud URLs don't include the data needed to create an embed, so have to add that manually + - Annoyingly soundcloud URLs don't include the data needed to create an embed, so have to add that manually. Perhaps this will help? https://developers.soundcloud.com/docs/oembed#introduction - [ ] Auto-import from UUID [using release IDs](https://musicbrainz.org/ws/2/recording/013efa85-b7f5-4f95-809b-ff47c53726a9?inc=artist-credits%20artist-rels%20url-rels&fmt=json) — more complex to get composer info (eg. [here](https://musicbrainz.org/ws/2/recording/bfbd2167-db3a-469a-a0a3-3fdeacbd4344?inc=artist-credits%20artist-rels%20url-rels%20work-rels%20work-level-rels&fmt=json)) - `composer: .relations[type=performance].work.relations[type=composer].name` - `title: .title` (Or album, if path is `/release` not `/recording`)