aboutsummaryrefslogtreecommitdiffstats
path: root/_includes/header.html
blob: 04d890176baa562dbf74aa653834e61efd64b0d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<header class="site-header">

    <div class="header__title">
      <h1>
        <a class="site-title" href="{{ site.baseurl }}/"><img src="{{ site_full_url }}/static/aswhite.png"/ height="40px" style="margin:20px ">{{ site.title }}</a>
      </h1>
    </div>
    <nav class="navigation header__navigation">
      {% assign url_tokens = page.url | split: '/' %}
      {% assign main_page_href = '/' | append: url_tokens[1] %}
      {% assign subpage_href = '/' | append: url_tokens[2] %}
      <ul>
        {% if site.data.navi.items[0] %}
          {% for item in site.data.navi.items %}
              {% if item.href == main_page_href or item.href == main_page_href | concat: '/' %}
                {% assign current_page = true %}
              {% else %}
                {% assign current_page = false %}
              {% endif %}
            <li class="navigation__item {% if current_page %}active{% endif %}">
              <a href="{{ site_full_url }}{{ item.href }}">{{ item.title }}</a>
            </li>
            {% if current_page and item.subnavi %}
              {% assign subnavi = item.subnavi %}
            {% endif %}
          {% endfor %}
        {% endif %}
      </ul>
    </nav>
    {% if subnavi %}
      <nav id="navigation_sub" class="navigation header__navigation">
        <ul>
            {% for subitem in subnavi.items %}
              <li class="navigation__item {% if subitem.href == subpage_href %}active{% endif %}">
                <a href="{{ site_full_url }}{{ main_page_href }}{{ subitem.href }}">{{ subitem.title }}</a>
              </li>
            {% endfor %}
        </ul>
      </nav>
    {% endif %}

</header>