From 484779fc5e4f3c455696216ad690c4f678814b03 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 28 Dec 2020 18:25:17 -0300 Subject: generate-favicon.rb: Generate PNG favicon from SVG --- _plugins/generate-favicon.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 _plugins/generate-favicon.rb (limited to '_plugins/generate-favicon.rb') diff --git a/_plugins/generate-favicon.rb b/_plugins/generate-favicon.rb new file mode 100644 index 0000000..11c038a --- /dev/null +++ b/_plugins/generate-favicon.rb @@ -0,0 +1,16 @@ +module Jekyll + class FaviconGenerator < Generator + safe true + priority :high + + SIZE = 420 + + def generate(site) + svg = 'static/favicon.svg' + png = 'static/favicon.png' + unless File.exist? png then + puts `inkscape -o #{png} -w #{SIZE} -h #{SIZE} #{svg}` + end + end + end +end -- cgit v1.2.3