mirror of
https://github.com/metagov/govarch-website.git
synced 2025-06-18 17:14:15 +00:00
add titleless posts and a menu in the footer
This commit is contained in:
21
_includes/menu.html
Normal file
21
_includes/menu.html
Normal file
@ -0,0 +1,21 @@
|
||||
{% assign menu = site.data.menu %}
|
||||
|
||||
{% if menu %}
|
||||
<nav class="site-navigation">
|
||||
<ul>
|
||||
{% for item in site.data.menu %}
|
||||
<li>
|
||||
{% if item.url contains 'http' %}
|
||||
<a href="{{ item.url }}">
|
||||
{{ item.title }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ item.url | prepend: site.baseurl }}">
|
||||
{{ item.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
26
_includes/post-list-item.html
Normal file
26
_includes/post-list-item.html
Normal file
@ -0,0 +1,26 @@
|
||||
{% capture excerpt %}
|
||||
{{ post.excerpt | replace: "<p>", "" | replace: "</p>", "" }}
|
||||
{% endcapture %}
|
||||
|
||||
{% assign excerpt_length = excerpt | size %}
|
||||
|
||||
<li>
|
||||
<a href="{{ post.url | absolute_url }}" class="post-link">
|
||||
{% unless post.title == "" %}
|
||||
<span class="post-title">
|
||||
{{ post.title }}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="post-title">
|
||||
{% if excerpt_length > 140 %}
|
||||
{{ excerpt | truncatewords: 12, '…' }}
|
||||
{% else %}
|
||||
{{ excerpt }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endunless %}
|
||||
<span class="post-date">
|
||||
{{ post.date | date: "%b %-d, '%y" }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
Reference in New Issue
Block a user