Issue #2: Added latest-posts.html.twig
This commit is contained in:
parent
d0e1b4cb12
commit
b4246bec69
|
@ -20,6 +20,10 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block sidebar %}
|
||||||
|
{% include 'latest-posts' %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
<footer class="container" role="contentinfo">
|
<footer class="container" role="contentinfo">
|
||||||
<p class="copyright">© 2010–{{ 'now'|date('Y') }} {{ site.title }}</p>
|
<p class="copyright">© 2010–{{ 'now'|date('Y') }} {{ site.title }}</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
{% if data.posts %}
|
||||||
|
<h2>Latest Posts</h2>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for post in data.posts | slice(0,5) %}
|
||||||
|
<li{% if page.url == post.url %} class="active"{% endif %}><a href="{{ post.url }}">{{ post.title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
Loading…
Reference in a new issue