Commit 2e1bf05d authored by Evaryont's avatar Evaryont

Handle plural vs singluar post counts

parent 92279384
Pipeline #18 failed with stage
in 2 minutes and 16 seconds
......@@ -19,3 +19,4 @@ gem 'wkhtmltopdf-heroku', require: false
gem 'onebox'
gem 'rake'
gem 'activesupport'
require 'pp'
require 'digest/sha1'
require 'geo_pattern'
require 'active_support/inflector' # for String#pluralize
$color_palette = ['#00c853', '#00e676', '#1b5e20', '#2e7d32', '#33691e',
'#388e3c', '#43a047', '#4caf50', '#558b2f', '#64dd17',
......
......@@ -3,7 +3,13 @@ layout: page
title: "Tags"
---
<p>There are <strong><%= page_articles.length %></strong> posts tagged with <%= tagname %>. <small>(See <a href="/blog/tags.html">all tags</a>.)</small></p>
<% len = page_articles.length %>
<p>
There <%= len == 1 ? "is" : "are" %> <strong><%= len %></strong> <%= "post".pluralize(len) %>
tagged with <%= tagname %>.
<small>(See <a href="/blog/tags.html">all tags</a>.)</small>
</p>
<% page_articles.each do |article| %>
<article class='archive-article'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment