From bdef04aaf59a89456496dbd6852965e95688fee3 Mon Sep 17 00:00:00 2001 From: Piotr Tabor Date: Tue, 6 Jan 2026 11:38:18 +0100 Subject: [PATCH 1/3] Add publishing of new files related to songbook editor. --- .github/workflows/publish_page.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish_page.yml b/.github/workflows/publish_page.yml index 8084c611..cc48c218 100644 --- a/.github/workflows/publish_page.yml +++ b/.github/workflows/publish_page.yml @@ -69,8 +69,7 @@ jobs: run: | mkdir -p _site/songs_html _site/songs_tex _site/songs_pdf unzip -o _generated/*.zip -d _site - mv _generated/index.html _site/ - mv _generated/sitemap.xml _site/ + mv _generated/index.html _generated/sitemap.xml _generated/*.json _generated/songbook_edit.* _site/ mv _generated/*.pdf _site/songs_tex/ mv _generated/songs_pdf/*.pdf _site/songs_pdf mv _generated/*.epub _site/ From 977411a57cefaee227206e7ba6ebcfce2fa78623 Mon Sep 17 00:00:00 2001 From: Piotr Tabor Date: Tue, 6 Jan 2026 12:42:41 +0100 Subject: [PATCH 2/3] Add additiona files. --- .github/workflows/generate_all.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generate_all.yml b/.github/workflows/generate_all.yml index 8f2138fa..a61946ac 100644 --- a/.github/workflows/generate_all.yml +++ b/.github/workflows/generate_all.yml @@ -203,7 +203,9 @@ jobs: /workspace/build/*.zip /workspace/build/index.html /workspace/build/sitemap.xml + /workspace/build/*.json /workspace/build/*.js + /workspace/build/songbook_edit.* - name: Upload htmls to release From 52530b6c1169ff0e2547137a9bcd8feabcccf6ee Mon Sep 17 00:00:00 2001 From: Piotr Tabor Date: Tue, 6 Jan 2026 18:28:08 +0100 Subject: [PATCH 3/3] Fix ambiguous song paths in generated artifacts - Update index_generator.py to include relative 'path' field in index.json - Update songbook_edit.js to use full path for song matching instead of ID-based glob --- src/html/index_generator.py | 4 ++++ src/html/templates/songbook_edit/songbook_edit.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/html/index_generator.py b/src/html/index_generator.py index bea6f3de..058c6572 100644 --- a/src/html/index_generator.py +++ b/src/html/index_generator.py @@ -260,6 +260,10 @@ def create_index_json(list_of_songs_meta, target_dir): if song.text_author(): song_data["text_author"] = song.text_author() + # Add path relative to repo root for unambiguous matching + if song.plik(): + song_data["path"] = os.path.relpath(song.plik(), start=sb.repo_dir()) + songs_data.append(song_data) # Build songbooks list diff --git a/src/html/templates/songbook_edit/songbook_edit.js b/src/html/templates/songbook_edit/songbook_edit.js index 20f2ad6c..74de544b 100644 --- a/src/html/templates/songbook_edit/songbook_edit.js +++ b/src/html/templates/songbook_edit/songbook_edit.js @@ -560,7 +560,12 @@ function generateYAML() { // Add individual selected songs as glob patterns Array.from(selectedSongIds).forEach(id => { - songbook.songs.push({ glob: `songs/**/${id}.xml` }); + const song = songById.get(id); + if (song && song.path) { + songbook.songs.push({ glob: song.path }); + } else { + songbook.songs.push({ glob: `songs/**/${id}.xml` }); + } }); const yaml = JSON.stringify({ songbook }, null, 2);