From a3995bf898c38ed755a3e1bd60b3b4aaf27670ec Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Wed, 9 Apr 2014 17:41:17 +0200 Subject: add custom blog article summary generator that truncates to first pararaph --- config.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config.rb') diff --git a/config.rb b/config.rb index 14ca283..93d7cc5 100644 --- a/config.rb +++ b/config.rb @@ -15,6 +15,9 @@ activate :blog do |blog| # blog.layout = "layout" # blog.summary_separator = /(READMORE)/ # blog.summary_length = 250 + + blog.summary_generator = Proc.new {|article, rendered, length, ellipsis| Nokogiri::HTML(rendered).at_xpath("//p[1]").to_s + link_to(ellipsis, article) } + # blog.year_link = "{year}.html" # blog.month_link = "{year}/{month}.html" # blog.day_link = "{year}/{month}/{day}.html" -- cgit v1.2.1