I have been using Jekyll for a month or two now, I am also new to Ruby so learning every day.
In my site I want to add the reading time of blog posts, I have found this ruby gem which will let me do it
https://github.com/garethrees/readingtime
I install it in the normal way into my sites root and add the code needed and nothing happens. This isn't a shock because I have no actually link to it in my sites root?
So it my site looks like this html wise
---
layout: default
---
<div class="twelve columns">
<h3>{{ page.title }}</h3>
<span class="date">Wrote by Josh Hornby</span>
<span class="date">Estimated reading time – <%= @article.body.reading_time %> </span>
<br /> <br />
<%= @article.body %>
{{ content }}
</article>
<a href="https://twitter.com/intent/tweet?text=Check out this blog by @joshua_hornby - www.joshhornby.co.uk"> <div class="twitter_button"> <img src="/images/twitter.png" alt="twitter-logo" width="50" height="50" /> </div> </a>
</div>
<div class="four columns">
<h3>Recent Posts</h3>
<p>Find out what else I've been talking about:</p>
{% for post in site.related_posts limit: 10 %}
<ul class="square">
<li><a class="title" style="text-decoration:none;" href="{{post.url}}"><strong>{{ post.title }}</strong></a>
{% endfor %}
</ul>
</div>
Now I'm not shocked that its not working but my question is how to a install the gem so I can access it in my Jekyll file? Do I need to create a _plugin
directory and call it from there? Or won't it work as its not a jekyll plugin? In that case I may have a little project writing my own Ruby Jekyll plugin.