mirror of
https://github.com/MinimalBible/MinimalBible.github.io
synced 2025-08-31 19:54:47 -04:00
Add related posts to post.html _layout
This commit is contained in:
@ -43,15 +43,27 @@
|
||||
</footer>
|
||||
</div><!-- /.entry-content -->
|
||||
{% if site.disqus_shortname and page.comments %}<section id="disqus_thread"></section><!-- /#disqus_thread -->{% endif %}
|
||||
{% if page.previous %}<div class="read-more">
|
||||
<div class="read-more-header">
|
||||
<a href="{{ site.url }}{{ page.previous.url }}" class="read-more-btn">Read More</a>
|
||||
</div><!-- /.read-more-header -->
|
||||
<div class="read-more-content">
|
||||
<h3><a href="{{ site.url }}{{ page.previous.url }}" title="{{ page.previous.title }}">{{ page.previous.title }}</a></h2>
|
||||
<p>{% if page.previous.description %}{{ page.previous.description }}{% else %}{{ page.previous.content | strip_html | strip_newlines | truncate: 120 }}{% endif %} <a href="{{ site.url }}{{ page.previous.url }}">Continue reading</a></p>
|
||||
</div><!-- /.read-more-content -->
|
||||
</div><!-- /.read-more -->{% endif %}
|
||||
{% if site.related_posts.size %}
|
||||
<div class="read-more">
|
||||
{% for post in site.related_posts limit:1 %}
|
||||
<div class="read-more-header">
|
||||
<a href="{{ site.url }}{{ page.previous.url }}" class="read-more-btn">Read More</a>
|
||||
</div><!-- /.read-more-header -->
|
||||
<div class="read-more-content">
|
||||
<h3><a href="{{ site.url }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h3>
|
||||
<p>{% if post.description %}{{ post.description }}{% else %}{{ content | strip_html | strip_newlines | truncate: 140 }}…{% endif %} <a href="{{ site.url }}{{ post.url }}">Continue reading</a></p>
|
||||
</div><!-- /.read-more-content -->
|
||||
{% endfor %}
|
||||
<div class="read-more-list">
|
||||
{% for post in site.related_posts limit:2 offset:1 %}
|
||||
<div class="list-item">
|
||||
<h4><a href="{{ site.url }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h4>
|
||||
<span>Published on {{ post.date | date: "%B %d, %Y" }}</span>
|
||||
</div><!-- /.list-item -->
|
||||
{% endfor %}
|
||||
</div><!-- /.read-more-list -->
|
||||
{% endif %}
|
||||
</div><!-- /.read-more -->
|
||||
</article>
|
||||
</div><!-- /#main -->
|
||||
|
||||
|
Reference in New Issue
Block a user