Repository is archived
No commit activity in last 3 years
No release in over 3 years
Tweet about the articles on Middleman blog
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
~> 1.5
>= 0
>= 0
>= 0
>= 0

Runtime

< 2.0, >= 0.17.0
~> 5.13
 Project Readme

Middleman::Blog::Twitter

Tweet about the latest article on Middleman blog.

Installation

Add this line to your application's Gemfile:

gem 'middleman-blog-twitter'

And then execute:

$ bundle

Or install it yourself as:

$ gem install middleman-blog-twitter

Usage

1. Settings(Tweet text template)

Create ERB for tweet text(ex. tweet_template.txt.erb).

Blog updated: <%= latest_article.title %> <%= hostname %><%= latest_article.url %>

Available variables

name value
latest_article Middleman::Sitemap::Resource included Middleman::Blog::BlogArticle object of the latest blog article
hostname Your blog hostname(set in the next section)

2. Settings(Tokens, hostname, and template path)

On config.rb

activate :blog_twitter do |twitter|
  twitter.consumer_key          = 'YOUR CONSUMER KEY'
  twitter.consumer_secret       = 'YOUR CONSUMER SECRET'
  twitter.access_token          = 'YOUR ACCESS TOKEN'
  twitter.access_token_secret   = 'YOUR ACCESS TOKEN SECRET'
  twitter.hostname              = 'http://example.com' # your blog hostname
  twitter.template_path         = 'tweet_template.txt.erb'
  twitter.force_tweet           = false  # If true, tweet regardless of the date of latest article. (Default: false)
  twitter.new_article_threshold = 1.hour # Tweet if date of latest article newer than threshold. (Default: 1.hour)
end

3. Execute command

$ middleman tweet

then

Blog updated: <latest article title> <latest article url>

Contributing

  1. Fork it ( http://github.com//middleman-blog-twitter/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request