{% if page.color %}
{% assign background = page.color %}
{% elsif page.tags %}
{% for tag in page.tags %} {% assign post_tag_downcase = tag | downcase %} {% for blog_tag in site.blog_tags %} {% assign blog_tag_title = blog_tag.title | downcase %} {% if blog_tag_title == post_tag_downcase %} {% assign background = blog_tag.color %} {% endif %} {% endfor %} {% endfor %}
{% endif %}
<header class=“{% if page.title == 'Home' %}header__homepage{% endif %} bg–{{ background | default: 'green' }}”>
<nav> {% unless page.title == 'Home' %} <a class="header__home" href="{{ "/" | relative_url}}">{{ site.title | escape }}</a> {% endunless %} <ul> <li> <a class="header__link" href="/blog">Blog</a> </li> <li> <a class="header__link" href="/about">About</a> </li> <li> <a class="header__link" href="/contact">Contact</a> </li> </ul> </nav> {% unless page.title == 'Home' %} <h1 class="header__title">{{ page.title }}</h1> {% endunless %}
</header>