Add navigation data file to simplify link output/ordering
This commit is contained in:
parent
54771fd0a8
commit
dec03c6eee
|
@ -0,0 +1,8 @@
|
|||
- title: Blog
|
||||
url: "/blog/"
|
||||
|
||||
- title: Projects
|
||||
url: "/projects/"
|
||||
|
||||
- title: Careers
|
||||
url: "/careers/"
|
|
@ -7,23 +7,19 @@
|
|||
{% include logo.html color="dark" %}
|
||||
</a>
|
||||
|
||||
<!-- Page list -->
|
||||
{%- if page_paths -%}
|
||||
<!-- Site links -->
|
||||
{% assign links = site.data.navigation %}
|
||||
<ul class="footer-nav list--plain monospace">
|
||||
{%- for path in page_paths -%}
|
||||
{%- assign my_page = site.pages | where: "path", path | first -%}
|
||||
{% for link in links %}
|
||||
{% assign class = nil %}
|
||||
{% if page.url == my_page.url %}
|
||||
{% if page.url contains link.url or page.url contains link.title %}
|
||||
{% assign class = 'active' %}
|
||||
{% endif %}
|
||||
{%- if my_page.title -%}
|
||||
<li class="footer-nav__item">
|
||||
<a class="footer-link {{ class }}" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
|
||||
<a class="footer-link {{ class }}" href="{{ site.baseurl }}{{ link.url }}">{{ link.title }}</a>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
|
||||
<!-- Social icons-->
|
||||
<ul class="footer-social-list list--inline">
|
||||
|
|
|
@ -21,47 +21,43 @@
|
|||
</span>
|
||||
</button>
|
||||
|
||||
<!-- Page list -->
|
||||
{%- if page_paths -%}
|
||||
<ul class="nav-list list--plain monospace">
|
||||
{%- for path in page_paths -%}
|
||||
{%- assign my_page = site.pages | where: "path", path | first -%}
|
||||
{% assign class = nil %}
|
||||
{% if page.url == my_page.url %}
|
||||
{% assign class = 'active' %}
|
||||
{% endif %}
|
||||
{%- if my_page.title -%}
|
||||
<li class="nav-list__item">
|
||||
<a class="nav-list__link {{ class }}" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
<!-- Site links -->
|
||||
{% assign links = site.data.navigation %}
|
||||
<ul class="nav-list list--plain monospace">
|
||||
{% for link in links %}
|
||||
{% assign class = nil %}
|
||||
{% if page.url contains link.url or page.url contains link.title %}
|
||||
{% assign class = 'active' %}
|
||||
{% endif %}
|
||||
<li class="nav-list__item">
|
||||
<a class="nav-list__link {{ class }}" href="{{ site.baseurl }}{{ link.url }}">{{ link.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
<!-- Social icons (mobile only) -->
|
||||
<li class="nav-social-list hidden-md">
|
||||
<a class="nav-social-list__item text-white no-underline" href="https://www.twitter.com/{{ site.twitter_username| cgi_escape | escape }}">
|
||||
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#twitter' | relative_url }}"></use></svg>
|
||||
<span class="visually-hidden">Scribd on Twitter</span>
|
||||
</a>
|
||||
<a class="nav-social-list__item text-white no-underline" href="https://www.facebook.com/{{ site.facebook_username| cgi_escape | escape }}">
|
||||
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#facebook' | relative_url }}"></use></svg>
|
||||
<span class="visually-hidden">Scribd on Facebook</span>
|
||||
</a>
|
||||
<a class="nav-social-list__item text-white no-underline" href="https://www.linkedin.com/company/{{ site.linkedin_username| cgi_escape | escape }}">
|
||||
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#linkedin' | relative_url }}"></use></svg>
|
||||
<span class="visually-hidden">Scribd on LinkedIn</span>
|
||||
</a>
|
||||
<a class="nav-social-list__item text-white no-underline" href="https://github.com/{{ site.github_username| cgi_escape | escape }}">
|
||||
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#github' | relative_url }}"></use></svg>
|
||||
<span class="visually-hidden">Scribd on Github</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- Social icons (mobile only) -->
|
||||
<li class="nav-social-list hidden-md">
|
||||
<a class="nav-social-list__item text-white no-underline" href="https://www.twitter.com/{{ site.twitter_username| cgi_escape | escape }}">
|
||||
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#twitter' | relative_url }}"></use></svg>
|
||||
<span class="visually-hidden">Scribd on Twitter</span>
|
||||
</a>
|
||||
<a class="nav-social-list__item text-white no-underline" href="https://www.facebook.com/{{ site.facebook_username| cgi_escape | escape }}">
|
||||
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#facebook' | relative_url }}"></use></svg>
|
||||
<span class="visually-hidden">Scribd on Facebook</span>
|
||||
</a>
|
||||
<a class="nav-social-list__item text-white no-underline" href="https://www.linkedin.com/company/{{ site.linkedin_username| cgi_escape | escape }}">
|
||||
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#linkedin' | relative_url }}"></use></svg>
|
||||
<span class="visually-hidden">Scribd on LinkedIn</span>
|
||||
</a>
|
||||
<a class="nav-social-list__item text-white no-underline" href="https://github.com/{{ site.github_username| cgi_escape | escape }}">
|
||||
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#github' | relative_url }}"></use></svg>
|
||||
<span class="visually-hidden">Scribd on Github</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Github links (mobile only) -->
|
||||
<li class="hidden-md monospace fs-md">
|
||||
<a class="nav-github-link text-white" href="{{site.github.repository_url}}/edit/{{ site.branch }}/{{page.path}}">Improve this Page</a><a class="nav-github-link text-white" href="{{site.github.repository_url}}/commits/{{ site.branch }}/{{page.path}}">Page History</a>
|
||||
</li>
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
<!-- Github links (mobile only) -->
|
||||
<li class="hidden-md monospace fs-md">
|
||||
<a class="nav-github-link text-white" href="{{site.github.repository_url}}/edit/{{ site.branch }}/{{page.path}}">Improve this Page</a><a class="nav-github-link text-white" href="{{site.github.repository_url}}/commits/{{ site.branch }}/{{page.path}}">Page History</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
|
Loading…
Reference in New Issue