Sha256: 6f982772ec03ffd300200944066e8874ee28e18c9b1060bd16f26f26fdc377e6
Contents?: true
Size: 813 Bytes
Versions: 3
Compression:
Stored size: 813 Bytes
Contents
module Jekyll module Academicons module Svg class AcademiconsIcon def initialize(icon) @icon = icon end # absolute path to file def to_filename base_directory = __dir__ + "/assets/" base_directory + "academicons.svg" end def to_svg_html file = File.read(to_filename) re = /<glyph.*glyph-name="#{@icon}" data-tags=".+ d="(.*)"/ svg_html = file.scan(re) "<symbol id='#{@icon}' viewBox='0 0 1024 1024'> <title>#{@icon}</title> <path class='path1' d='#{svg_html[0][0]}'></path> </symbol> " end def value @icon end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems