我一直在使用傑基爾了一兩個月,現在,我也是新來的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插件。