Sha256: c7ac0896bb208a4d4ce5ad8ae73e2ca4a1e4bd80efd80aae35376bdd10081ea4

Contents?: true

Size: 1.64 KB

Versions: 1

Compression:

Stored size: 1.64 KB

Contents

# middleman-hatenastar

[![test](https://github.com/unasuke/middleman-hatenastar/actions/workflows/ruby.yml/badge.svg)](https://github.com/unasuke/middleman-hatenastar/actions/workflows/ruby.yml)
[![codecov](https://codecov.io/gh/unasuke/middleman-hatenastar/branch/master/graph/badge.svg)](https://codecov.io/gh/unasuke/middleman-hatenastar)

middleman-hatenastar is a hatenastar extension for Middleman.

## Usage

### 1. bundle install

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

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

and run `bundle install`

### 2. get your hatenastar token

See also → [はてなスターをブログに貼り付ける - はてなスター日記](http://d.hatena.ne.jp/hatenastar/20070707/1184453490)

### 3. activate hatenastar extension and setting it

```ruby
# 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

```slim
doctype html
html
  head
    = hatenastar_tag
```

You can overwrite setting like this.

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

### 5. build middleman site!

```shell
$ 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](http://opensource.org/licenses/MIT).

## Reference

- [はてなスターをブログに設置するには - はてなスター日記](http://d.hatena.ne.jp/hatenastar/20070707)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
middleman-hatenastar-0.2.0 README.md