<!doctype html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=0.75">
  <script type="text/javascript" src="{{ '/static/script.js'|url }}"></script>
  <link rel="stylesheet" href="{{ '/static/style.css'|url }}">
  <link rel="icon" sizes="32x32" href="{{ '/img/icon-32.png'|url }}">
  <link rel="icon" sizes="196x196" href="{{ '/img/icon-196.png'|url }}">
  <link rel="apple-touch-icon" sizes="180x180" href="{{ '/img/icon-180.png'|url }}">
  <link rel="manifest" href="{{ '/app.webmanifest'|asseturl }}">
  <title>{% block title %}Welcome{% endblock %} · recipe lekture</title>
</head>
<body> {#- ontouchstart="" #}
  <header>
    <a id="logo" href="{{ '/'|url }}">recipe lekture</a>
    <nav>
      <ul>
        {%- set allRecipes = site.get('/recipes', this.alt) %}
        <li><a {% if this == allRecipes -%}
          class="active"
        {%- endif %} href="{{ allRecipes|url }}">{{ bag('i18n+' + this.alt, 'title.all_recipes') }}</a></li>

        {%- for groupby in site.query('/groupby', this.alt) %}
        <li><a {% if this.url_path.startswith(groupby.url_path) -%}
          class="active"
        {%- endif %} href="{{ groupby|url }}">{{ groupby.name }}</a></li>
        {%- endfor %}
      </ul>
    </nav>
    <div class="tags small">
      {%- for tag in site.query('/tags', this.alt) %}
      <a {%
      if this.is_child_of(tag) or (this.tags and tag._id in this.tags) -%}
        class="active"
      {%- endif %} href="{{ tag|url }}">{{ tag.name }}</a>
      {%- endfor %}
    </div>
  </header>
  <div class="page">
    {% block body %}{% endblock %}
  </div>
  <footer>{#--#}
    <table width="100%">{#--#}
      <td>Build with <a href="https://www.getlektor.com/">Lektor</a>, template by <a href="https://github.com/relikd/lektor-recipes">relikd</a>.</td>{#--#}
      <td class="buttons xlarge">
        {#-
        we could use `site.get('/recipes.tex@LatexPDF', alt=this.alt) | url`
        but then this will create a dependency on all recipes
        -#}
        <a href="{{ '/'|url + 'recipes.pdf' }}" download="recipes-{{ this.alt }}.pdf" title="{{ bag('i18n+' + this.alt, 'other.get_pdf') }}">{#--#}
          <img class="h1em" alt="(PDF)" height="20" src="{{ '/img/icon-pdf.svg'|url }}">{#--#}
        </a>
        {%- set url_without_alt = ('.'|url(absolute=True))[4:] -%}
        {%- if this.alt == 'de' -%}
        <a href="/en/{{url_without_alt}}" title="zur englischen Seite wechseln">🇺🇸</a>
        {%- else -%}
        <a href="/de/{{url_without_alt}}" title="switch to german page">🇩🇪</a>
        {%- endif -%}
      </td>{#--#}
    </table>{#--#}
  </footer>
  <script type="text/javascript">const observer = lozad(); observer.observe();</script>
</body>
