Sha256: cdc0eb86bae4ac93841882a8cdc43f4a826566d391a741f84d59baae0f4d5f2c

Contents?: true

Size: 1.18 KB

Versions: 7

Compression:

Stored size: 1.18 KB

Contents

{% if site.navigation_header %}
<nav class="nav  nav--header">
  <button class="button  button--nav" aria-label="Nav toggle">
    {% include icon.html id="nav" %}
  </button>
  <ul class="list  list--nav">
    {% for item in site.navigation_header %}

      {% if item[1] contains '://' %}
      {% assign url = item[1] %}
      {% else %}
      {% assign url = item[1] | relative_url %}
      {% endif %}

      <li class="item  item--nav{% if item[1] == page.url %}  item--current{% endif %}">
        <a href="{{ url }}">{{ item[0] }}</a>
      </li>
    {% endfor %}
  </ul>
</nav>
{% else %}
  {% include nav-default.html %}
{% endif %}
<script type="text/javascript">
const applyToggle = (list, button, breakpoint) => {
  const navList = document.querySelector(list)
  if (document.body.clientWidth < breakpoint) {
    const navHeight = navList.clientHeight
    const navButton = document.querySelector(button)
    navList.style.maxHeight = '0px'

    navButton.onclick = () => {
      if (navList.style.maxHeight == '0px') {
        navList.style.maxHeight = `${navHeight}px`
      } else {
        navList.style.maxHeight = '0px'
      }
    }
  }
}

applyToggle('.list--nav', '.button', 640)
</script>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
alembic-jekyll-theme-2.2.4 _includes/nav-header.html
alembic-jekyll-theme-2.2.3 _includes/nav-header.html
alembic-jekyll-theme-2.2.2 _includes/nav-header.html
alembic-jekyll-theme-2.2.1 _includes/nav-header.html
alembic-jekyll-theme-2.2.0 _includes/nav-header.html
alembic-jekyll-theme-2.1.2 _includes/nav-header.html
alembic-jekyll-theme-2.1.1 _includes/nav-header.html