Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/generate_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish_page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 4 additions & 0 deletions src/html/index_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/html/templates/songbook_edit/songbook_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading