aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-12-28 18:25:17 -0300
committerEuAndreh <eu@euandre.org>2020-12-28 18:26:14 -0300
commit484779fc5e4f3c455696216ad690c4f678814b03 (patch)
tree96c11cbdf6199f84845cf0de5b780213a5621159
parentUse PNG favicon on Atom feed and audio file metadata (diff)
downloadeuandre.org-484779fc5e4f3c455696216ad690c4f678814b03.tar.gz
euandre.org-484779fc5e4f3c455696216ad690c4f678814b03.tar.xz
generate-favicon.rb: Generate PNG favicon from SVG
Diffstat (limited to '')
-rw-r--r--.gitignore1
-rw-r--r--_plugins/generate-favicon.rb16
-rw-r--r--default.nix1
3 files changed, 18 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 30cc365..a96d257 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
/_site/
/.jekyll-cache/
/images/graphviz/
+/static/favicon.png
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
diff --git a/default.nix b/default.nix
index 6f4ea2b..443d2c8 100644
--- a/default.nix
+++ b/default.nix
@@ -29,6 +29,7 @@ let
flac
mediainfo
mkvtoolnix-cli
+ inkscape
perl
graphviz