<header class="header">
  <nav class="navbar">
    <div class="navbar-brand">
      <a class="navbar-item" href="{{{or site.url siteRootPath}}}">{{site.title}}</a>
      {{#if env.SITE_SEARCH_PROVIDER}}
      <div class="navbar-item search hide-for-print">
        <div id="search-field" class="field">
          <input id="search-input" type="text"
            placeholder="{{#if (eq page.version 'latest-de')}}Dokumentation durchsuchen…{{else}}Search the docs…{{/if}}"
            {{#if page.home}} autofocus{{/if}}>
        </div>
      </div>
      {{/if}}
      <button class="navbar-burger" aria-controls="topbar-nav" aria-expanded="false" aria-label="Toggle main menu">
        <span></span>
        <span></span>
        <span></span>
      </button>
    </div>
    <div id="topbar-nav" class="navbar-menu">
      <div class="navbar-end">
      </div>
    </div>
  </nav>
</header>
<script>
(function () {
  var version = '{{page.version}}';
  if (!version) return;
  var versionPath = '/' + version + '/';
  document.addEventListener('DOMContentLoaded', function () {
    new MutationObserver(function () {
      document.querySelectorAll('.search-result-item').forEach(function (item) {
        var a = item.querySelector('a[href]');
        if (a && a.href.indexOf(versionPath) === -1) {
          item.style.display = 'none';
        }
      });
    }).observe(document.body, { childList: true, subtree: true });
  });
})();
</script>
