Class: Jekyll::StripeButtonTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll-stripe.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ StripeButtonTag

Returns a new instance of StripeButtonTag.



14
15
16
17
# File 'lib/jekyll-stripe.rb', line 14

def initialize(tag_name, text, tokens)
  super
  @id = text.strip
end

Instance Method Details

#render(context) ⇒ Object



19
20
21
22
23
24
# File 'lib/jekyll-stripe.rb', line 19

def render(context)
  style = "background-color:#6772E5;color:#FFF;padding:8px 12px;border:0;border-radius:4px;font-size:1em"

  "<button style=\"#{style}\" type=\"button\" role=\"link\" data-buybutton-id=\"#{@id}\">Buy now</button> " +
  "<span class=\"buybutton-error\"></span>"
end