Sha256: deaddd9c1944702df84cff1f4a075019193c06bf2003ce93097ea7c782389a01

Contents?: true

Size: 692 Bytes

Versions: 1

Compression:

Stored size: 692 Bytes

Contents

module Jekyll
    class ButtonTagBlock < Liquid::Block
  
        def initialize(tag_name, text, tokens)
            super
            @input = text
        end

        def render(context)
            
            input_split = split_params(@input)
            theme = input_split[0].strip
            link = input_split[1].strip
            icon = input_split[2].strip

            text = super
            "<div class='sx-button'><a href='#{link}' class='sx-button__content #{theme}'><img src='#{icon}'/>#{text}</a></div>"
        end

        def split_params(params)
            params.split("|")
        end
    end
end
  
Liquid::Template.register_tag('button', Jekyll::ButtonTagBlock)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-theme-simplex-0.9.5.1 _plugins/button.rb