From a781fe5046c4b33cd1c860d284bd799b4ca38f2e Mon Sep 17 00:00:00 2001 From: pdp8 Date: Wed, 14 Feb 2024 14:47:10 +0100 Subject: picture import --- html.rb | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'html.rb') diff --git a/html.rb b/html.rb index 8ad6c07..171d487 100755 --- a/html.rb +++ b/html.rb @@ -41,6 +41,10 @@ def music_html music = Dir[File.join(MEDIA_DIR, 'music', '*')].sort.reverse html = File.read(File.join(SNIPPETS, 'head.html')) html += nav 'music' + html += '
← prev | + faircamp webring | + random | + next →
' music.each do |dir| next if dir.match 'alfadeo' @@ -50,8 +54,9 @@ def music_html html += "

#{title}

" html += File.read(File.join(dir, 'README')).chomp.gsub("\n\n", '

').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 += "cover" + html += "#{alt}" html += '' copyrights_file = File.join(dir, 'copyrights') copyrights = File.readlines(copyrights_file).collect { |l| l.chomp } if File.exist? copyrights_file @@ -63,7 +68,8 @@ def music_html html += "" html += "" html += '' @@ -119,8 +125,9 @@ def video_html w, h = `ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 #{webm}`.chomp.split(',') html += "

" html += lines.join('
') @@ -146,9 +153,9 @@ def climbing_html html += '

' html += "

#{post[:date]}

" html += "

" html += post[:text] @@ -160,11 +167,11 @@ def climbing_html end music_html -picture_html +# picture_html video_html climbing_html -%w[about code contact].each do |basename| +%w[about code pictures contact].each do |basename| file_html basename end -- cgit v1.2.3

#{name}