diff options
author | EuAndreh <eu@euandre.org> | 2020-12-24 21:20:05 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-12-25 03:36:24 -0300 |
commit | 998618daf80d2bb1d6848ff0309c0ef9b80d5827 (patch) | |
tree | 2879e695bec0ca783c295ad7d1b1ca5d222e05f7 /_plugins/linter.rb | |
parent | Don't run linter on generated files (diff) | |
download | euandre.org-998618daf80d2bb1d6848ff0309c0ef9b80d5827.tar.gz euandre.org-998618daf80d2bb1d6848ff0309c0ef9b80d5827.tar.xz |
Move torrent and media generators out of linter.rb
Diffstat (limited to '')
-rw-r--r-- | _plugins/linter.rb | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/_plugins/linter.rb b/_plugins/linter.rb index ac1c6ed..d0329cc 100644 --- a/_plugins/linter.rb +++ b/_plugins/linter.rb @@ -2,11 +2,12 @@ require 'set' IGNORED_PAGES = Set['sitemap.xml'] LANGS = Set['en', 'pt', 'fr', 'eo'] # jp zh es de -TRACKERS = '-a udp://tracker.coppersurfer.tk:6969/announce -a udp://tracker.ccc.de:80/announce -a udp://tracker.publicbt.com:80 -a udp://tracker.istole.it:80 -a http://tracker.openbittorrent.com:80/announce -a http://tracker.ipv6tracker.org:80/announce' module Jekyll class Linter < Generator safe true + priority :high + @@known_ids = Set[] def insert_id(name, document) @@ -116,20 +117,6 @@ module Jekyll raise "Missing FLAC file '#{flac}'" end - file = "#{date}-#{slug}.ogg" - ogg = "resources/podcasts/#{date}-#{slug}.ogg" - unless File.exist? ogg then - puts "Missing '#{ogg}' file, generating..." - puts `ffmpeg -i #{flac} -ar 48000 -vn -c:a libvorbis -b:a 320k #{ogg}` - site.static_files << Jekyll::StaticFile.new(site, site.source, '', ogg) - end - - torrent = "#{ogg}.torrent" - unless File.exist? torrent then - webseed = "#{site.config['url']}/#{ogg}" - puts "Missing '#{torrent}' file, generating..." - puts `mktorrent #{TRACKERS} -f -v -d -c '#{document.content}' -n #{file} -w #{webseed} -o #{torrent} #{ogg}` - end end if name == 'screencasts' then @@ -137,14 +124,6 @@ module Jekyll unless File.exist? mkv then raise "Missing MKV file '#{mkv}'" end - - torrent = "#{mkv}.torrent" - unless File.exist? torrent then - webseed = "#{site.config['url']}/#{mkv}" - file = "#{date}-#{slug}.mkv" - puts "Missing '#{torrent}' file, generating..." - puts `mktorrent #{TRACKERS} -f -v -d -c '#{document.content}' -n #{file} -w #{webseed} -o #{torrent} #{mkv}` - end end end |