我一直在使用杰基尔了一两个月,现在,我也是新来的Ruby所以每天的学习。使用插件在杰基尔
在我的地盘我要添加博客文章的阅读时间,我发现这个红宝石的宝石,这将让我做
https://github.com/garethrees/readingtime
我安装它以正常的方式进入我的网站的根并添加所需的代码,但没有任何反应。这并不令人震惊,因为我的网站根目录中没有实际的链接。
所以我的网站看起来像这个网站明智
---
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>
现在,我不感到震惊,它不工作,但我的问题是如何将安装宝石,所以我可以在我的化身文件访问呢?我需要创建一个_plugin
目录并从那里打电话吗?或者它不会工作,因为它不是一个jekyll插件?在这种情况下,我可能会有一个项目编写我自己的Ruby Jekyll插件。