aboutsummaryrefslogblamecommitdiff
path: root/_plugins/generate-favicon.rb
blob: 71fbb9ee2081298eca2daf8674de45f3e176f0ff (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                    
                                              
                                                              
                                                                               



         
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 "Missing '#{png}', generating..."
        puts `inkscape -o #{png} -w #{SIZE} -h #{SIZE} #{svg}`
        site.static_files << Jekyll::StaticFile.new(site, site.source, '', png)
      end
    end
  end
end