This works fine:
<% blog.articles.each_with_index do |article, i| %>
<h2><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></h2>
<%= article.body %>
<% end %>
This throws an error:
<h2><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></h2>
<%= article.summary %>
<% end %>
Something about that summary…
TypeError: type mismatch: String given
/Users/bob/.rvm/gems/ruby-2.3.0/gems/middleman-blog-4.0.0/lib/middleman-blog/blog_article.rb:110:in `=~'
/Users/bob/.rvm/gems/ruby-2.3.0/gems/middleman-blog-4.0.0/lib/middleman-blog/blog_article.rb:110:in `default_summary_generator'
/Users/bob/.rvm/gems/ruby-2.3.0/gems/middleman-blog-4.0.0/lib/middleman-blog/blog_article.rb:98:in `summary'
/Users/bob/Dropbox/Web Development/Projects/Middleman/BRP/source/index.html.erb:11:in `block (2 levels) in singleton class'
and so on…
Here’s the part of my config.rb concerning the blog gem:
activate :blog do |blog|
# This will add a prefix to all links, template references and source paths
# blog.prefix = "blog"
# blog.permalink = "{year}/{month}/{day}/{title}.html"
# Matcher for blog source files
blog.sources = "posts/{year}-{month}-{day}-{title}.html"
# blog.taglink = "tags/{tag}.html"
# blog.layout = "layout"
blog.summary_separator = "==="
blog.summary_length = 250
# blog.year_link = "{year}.html"
# blog.month_link = "{year}/{month}.html"
# blog.day_link = "{year}/{month}/{day}.html"
# blog.default_extension = ".markdown"
blog.tag_template = "tag.html"
blog.calendar_template = "calendar.html"
# Enable pagination
blog.paginate = true
blog.per_page = 10
blog.page_link = "page/{num}"
end
# activate :directory_indexes
And my gemfile:
source 'http://rubygems.org'
# Middleman Gems
gem "middleman", "~> 4.1.0"
gem "middleman-blog"
gem "middleman-livereload"
gem 'middleman-autoprefixer'
# gem 'redcarpet', '~> 3.3', '>= 3.3.3'
# For feed.xml.builder
gem "builder", "~> 3.0"
Where have I gone wrong?