Class: Middleman::Hatenastar::Extension

Inherits:
Extension
  • Object
show all
Defined in:
lib/middleman-hatenastar/extension.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options_hash = {}, &block) ⇒ Extension

Returns a new instance of Extension.



13
14
15
16
17
18
19
20
21
# File 'lib/middleman-hatenastar/extension.rb', line 13

def initialize(app, options_hash={}, &block)
  super

  if options[:token] == nil
    raise ArgumentError, 'Hatenastar token is required.'
  end

  @generator = ::Middleman::Hatenastar::Generator.new(options)
end

Instance Method Details

#hatenastar_tag(uri: nil, title: nil, container: nil, entry_node: nil) ⇒ Object



25
26
27
# File 'lib/middleman-hatenastar/extension.rb', line 25

def hatenastar_tag(uri: nil, title: nil, container: nil, entry_node: nil)
  @generator.generate(uri: uri, title: title, container: container, entry_node: entry_node)
end