Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
preprocess do # Get articles articles = items.select { |i| i[:kind] == 'article' }.sort_by { |a| Time.parse(a[:created_at]) } # Paginate articles article_groups = [] article_groups << articles.slice!(0..config[:page_size]-1) until articles.empty? # For each group of articles article_groups.each_with_index do |articles, i| # Create a pagination item items << Nanoc3::Item.new( "<%= render 'pagination_page', :articles_per_item => #{config[:page_size]}, :item_id => #{i} %>", { :title => "Blog - Archive (#{i+1})" }, "/blog/#{i+1}/" ) end end
This paste will be private.
From the Design Piracy series on my blog: