#!/usr/bin/env ruby require_relative 'lib' music = Dir[File.join(MEDIA_DIR, 'music', '20*')].sort.reverse html = File.read(File.join(SNIPPETS, 'head.html')) html += nav 'music' html += '
' music.each do |dir| date = File.basename(dir).split('_')[0] html += "').gsub("\n", '
') # + '
' cover = File.join(MEDIA_URL, dir.sub(MEDIA_DIR, ''), 'cover.webp') alt = File.read(File.join(dir, 'cover.txt')).chomp w, h = `identify -format "%w %h" #{cover}`.chomp.split(' ') html += "" html += '
#{name} | " html += "" html += ' |
Internet Archive: #{ia}" bc = if File.exist?(File.join(dir, 'bandcamp')) File.read(File.join(dir, 'bandcamp')).chomp else "https://pdp8.bandcamp.com/album/#{title.gsub(' ', '-')}" end html += "
Bandcamp: #{bc}" html += '
© pdp8 Creative Commons Attribution 4.0 International License' html += File.read(File.join(SNIPPETS, 'tail.html')) print_html 'music', html