So I want to show a link in my theme's header on every page if (and only if) the home page is static. In Chyrp Lite, I accomplished this with a frankly super ugly Twig hack:
Code: Select all
<div class="logo">
{# The logotype goes here. #}
<h1><a href="{{ url('/') }}">{{ site.name }}</a></h1>
{# If the blog has a static home page, a link to the blog will be shown in the header. If you want to use a different slug for your home page, change it below. #}
{% if theme.pages_list() is not empty %}
{% for item in theme.pages_list %}
{% if item.slug == "home" %}
<span>/ <a href="{{ url('/index') }}">blog</a></span>
{% endif %}
{% endfor %}
{% endif %}
</div>
Code: Select all
if homepage is static
print my link
endif