/middleman-hatenastar

:star2: :star2: :star2: :star2: :star2: :star2: :star2: :star2: :star2: :star2: :star2: :star2:

Primary LanguageRubyMIT LicenseMIT

middleman-hatenastar

test codecov

middleman-hatenastar is a hatenastar extension for Middleman.

Usage

1. bundle install

# Gemfile
source 'https://rubygems.org'

gem 'middleman', '>= 4.0.0'
gem 'middleman-hatenastar'

and run bundle install

2. get your hatenastar token

See also → はてなスターをブログに貼り付ける - はてなスター日記

3. activate hatenastar extension and setting it

# your middleman config.rb
activate :hatenastar,
  token: 'your token',
  uri: 'h3 a',
  title: 'h3',
  container: 'h3',
  entry_node: 'div.section'

4. invoke hatenastar_tag in your layout

doctype html
html
  head
    = hatenastar_tag

You can overwrite setting like this.

doctype html
html
  head
    = hatenastar_tag(uri: 'h4 a', entry_node: 'div.another-section')

5. build middleman site!

$ bundle exec middleman build

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/unasuke/middleman-hatenastar.

License

The gem is available as open source under the terms of the MIT License.

Reference