Skip to content

fix: copy collection static files to Jekyll output#53

Merged
tallnato merged 1 commit intomainfrom
paperclip/backelino/NAT-129
Mar 27, 2026
Merged

fix: copy collection static files to Jekyll output#53
tallnato merged 1 commit intomainfrom
paperclip/backelino/NAT-129

Conversation

@tallnato
Copy link
Copy Markdown
Member

Summary

  • Adds a Jekyll generator plugin (_plugins/copy_collection_files.rb) that copies non-document static files (.mp3, .wav, .fseq, .png, etc.) from _-prefixed collection directories into the _site/ output at the correct content/{collection}/{slug}/ paths
  • Adds type attribute to <source> elements in _layouts/item.html for better browser audio compatibility (mp3→audio/mpeg, wav→audio/wav, ogg→audio/ogg)

Why

Jekyll processes collection documents (Markdown) into HTML pages but does not automatically copy static files from _-prefixed collection directories to the build output. Audio files, thumbnails, and downloadable files were missing from the deployed site, breaking <audio> playback and download links.

How to verify

  1. npm install && npm run build && bundle exec jekyll build
  2. Confirm static files exist in _site/content/:
    • _site/content/boombox/sample-track/sample-track.mp3
    • _site/content/locksounds/sample-chime/sample-chime.wav
    • _site/content/lightshows/sample-show/sample-show.fseq
    • _site/content/wraps/sample-wrap/sample-wrap.png
  3. Check <source> elements include type attributes in generated HTML
  4. Works both locally (bundle exec jekyll serve) and in the deploy workflow

Test plan

  • Local jekyll build succeeds with all static files in _site/content/
  • Audio <source> elements include correct type attributes
  • Download links point to files that exist in build output
  • CI checks pass
  • Deploy workflow produces correct output

🤖 Generated with Claude Code

Jekyll collections in _-prefixed directories generate HTML pages for
documents but do not automatically output static files (audio, images,
etc.) alongside them. This adds a Jekyll generator plugin that copies
non-document files from collection directories into _site/ at the
correct paths, making audio and download files accessible.

Also adds the type attribute to <source> elements for better browser
compatibility with audio playback.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@github-actions github-actions bot added the site Changes to site layouts, includes, and config label Mar 27, 2026
Copy link
Copy Markdown
Member Author

@tallnato tallnato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review (Revinaldo)

No issues found. Checked for bugs and CLAUDE.md compliance.

  • _plugins/copy_collection_files.rb — correctly copies static files from _-prefixed collection dirs to _site/ output. Path construction, Pathname usage, and Dir.glob filtering are all sound.
  • _layouts/item.html — MIME type detection via Liquid is correct; type attribute is conditionally added only for known formats (mp3, wav, ogg).

LGTM — good to merge.

@tallnato tallnato merged commit c23d767 into main Mar 27, 2026
3 checks passed
@tallnato tallnato deleted the paperclip/backelino/NAT-129 branch March 27, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

site Changes to site layouts, includes, and config

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant