Adding Blog Features

Tags: journal, innovate, and tips
Personhours: 1
Adding Blog Features By Ethan

Task: Add Cool and New Blog Features

I remember, vaguely, that someone on our team wanted to add a post counter for all the posts people appear in. And, today, I did it out of sheer boredom. And, here it is.

{% assign eh = 1 %}
{% assign dc = 1 %}
{% assign ed = 1 %}
{% assign or = 1 %}
{% assign js = 1 %}
{% assign cr = 1 %}
{% assign dp = 1 %}
{% assign mv = 1 %}
{% assign tv = 1 %}
{% assign jc = 1 %}
{% assign inc = 1 %}
{% for post in site.posts %}
  {% for name in post.rollcall %}
    {% if name == "Ethan" %}
      {% assign eh = eh | plus: 1 %}
    {% endif %}
    {% if name == "Dylan" %}
      {% assign dc = dc | plus: 1 %}
    {% endif %}
    {% if name == "Evan" %}
      {% assign ed = ed | plus: 1 %}
    {% endif %}
    {% if name == "Omar" %}
      {% assign or = or | plus: 1 %}
    {% endif %}
    {% if name == "Jayesh" %}
      {% assign js = js | plus: 1 %}
    {% endif %}
    {% if name == "Caitlin" %}
      {% assign cr = cr | plus: 1 %}     {% endif %}
    {% if name == "Darshan" %}
      {% assign dp = dp | plus: 1 %}
    {% endif %}
    {% if name == "Max" %}
      {% assign mv = mv | plus: 1 %}
    {% endif %}
    {% if name == "Tycho" %}
      {% assign tv = tv | plus: 1 %}
    {% endif %}
    {% if name == "Janavi" %}
      {% assign jc = jc | plus: 1 %}
    {% endif %}
  {% endfor %}
  {% assign inc = inc | plus: 1 %}
{% endfor %}
<ul>
  <li> Dylan Chorley - in {{dc}} posts</li>
  <li> Evan Daane - in {{ed}} posts</li>
  <li> Ethan Helfman - in {{eh}} posts</li>
  <li> Omar Ramirez - in {{or}} posts</li>
  <li> Caitlin Rogers - in {{cr}} posts</li>
  <li> Jayesh Sharma - in {{js}} posts</li>
  <li> Darshan Patel - in {{dp}} posts</li>
  <li> Maximillian Virani - in {{mv}} posts</li>
  <li> Tycho Virani - in {{tv}} posts</li>
  <li> Janavi Chadha - in {{jc}} posts</li>
</ul>

Now, this is not obviously the best code, there's probably a more efficient way than creating one variable per person. But, it works.
We've been making improvements on the site since the season began - changing the theme, Caitlin's commits that updated the blog for the new season, and purging old member bios from the team, just like how Stalin purged political dissidents from pictures and sent them to gulags.

Edit: We now have a Iron Reign stats page! We have spent a solid two hours debugging this so please appreciate it. We addded Austin, and cumulative personhours for team members and Iron Reign as a whole.

Reflections

We still need to work on the blog. At least for my computer, it takes a long time to load the actual site as it loads every single post made, so I'd like to add pagination. As well, I'd personally want to add a second theme for very easy readability, something like this.

Written on October 5, 2016