{% if site.logo contains '://' %}
  {% assign site_logo = site.logo %}
{% else %}
  {% assign site_logo = site.logo | relative_url %}
{% endif %}

<header id="masthead">
  <div class="inner">
    <div class="title-area">
      {% if page.url == '/' %}
        <h1 class="site-title">
          <a href="{{ '/' | relative_url }}">
            {% if site.logo %}<img src="{{ site_logo }}" alt="" class="site-logo">{% endif %}
            <span>{{ site.title | escape }}</span>
          </a>
        </h1>
      {% else %}
        <p class="site-title">
          <a href="{{ '/' | relative_url }}">
            {% if site.logo %}<img src="{{ site_logo }}" alt="" class="site-logo">{% endif %}
            <span>{{ site.title | escape }}</span>
          </a>
        </p>
      {% endif %}
    </div>
  </div>
</header>