From 433428cf6b4ef8a653f349e0a0d1fa0d10aab1e7 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 3 Jan 2021 21:33:16 -0300 Subject: Generate favicon.ico from SVG --- _plugins/generate-favicon.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '_plugins/generate-favicon.rb') diff --git a/_plugins/generate-favicon.rb b/_plugins/generate-favicon.rb index 71fbb9e..08de8b2 100644 --- a/_plugins/generate-favicon.rb +++ b/_plugins/generate-favicon.rb @@ -13,6 +13,13 @@ module Jekyll puts `inkscape -o #{png} -w #{SIZE} -h #{SIZE} #{svg}` site.static_files << Jekyll::StaticFile.new(site, site.source, '', png) end + + ico = 'favicon.ico' + unless File.exist? ico then + puts "Missing '#{ico}', generating..." + puts `convert #{svg} #{ico}` + site.static_files << Jekyll::StaticFile.new(site, site.source, '', ico) + end end end end -- cgit v1.2.3