List last 3 blog posts in menu.

This commit is contained in:
Stephan 2021-03-22 20:58:05 +01:00
parent 4320b4ea0d
commit b95a4fd78d
2 changed files with 24 additions and 0 deletions

View File

@ -57,6 +57,18 @@
{{ sub_title }} {{ sub_title }}
</a> </a>
</li> </li>
{% if sub_title == 'Blog' %}
{% set children = site.get(href).children %}
{% for child in children %}
{% if loop.index <= 3 %}
<li class="primary_nav__sub_navitem {%- if this._path == href %} -active{%- endif %}">
<a class="primary_nav__navlink {% if this._path == href %}-active{% endif %}" href="{{ href|url }}">
{{ child.title }}
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}

View File

@ -57,6 +57,18 @@
{{ sub_title }} {{ sub_title }}
</a> </a>
</li> </li>
{% if sub_title == 'Blog' %}
{% set children = site.get(href).children %}
{% for child in children %}
{% if loop.index <= 3 %}
<li class="primary_nav__sub_navitem {%- if this._path == href %} -active{%- endif %}">
<a class="primary_nav__navlink {% if this._path == href %}-active{% endif %}" href="{{ href|url }}">
{{ child.title }}
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}