Use data file to maintain site navigation
- Remove top navigation links from _config.yml
This commit is contained in:
parent
cf086c3873
commit
f4869f79c4
3 changed files with 21 additions and 16 deletions
13
_config.yml
13
_config.yml
|
@ -32,19 +32,6 @@ google_verify:
|
||||||
# https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here
|
# https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here
|
||||||
bing_verify:
|
bing_verify:
|
||||||
|
|
||||||
# Links to include in top navigation
|
|
||||||
# For external links add external: true
|
|
||||||
links:
|
|
||||||
- title: About
|
|
||||||
url: /about/
|
|
||||||
- title: Posts
|
|
||||||
url: /posts/
|
|
||||||
- title: Theme Setup
|
|
||||||
url: /theme-setup/
|
|
||||||
- title: Made Mistakes
|
|
||||||
url: http://mademistakes.com
|
|
||||||
external: true
|
|
||||||
|
|
||||||
# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||||
timezone: America/New_York
|
timezone: America/New_York
|
||||||
future: true
|
future: true
|
||||||
|
|
13
_data/navigation.yml
Normal file
13
_data/navigation.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# Site navigation links
|
||||||
|
|
||||||
|
- title: About
|
||||||
|
url: /about/
|
||||||
|
|
||||||
|
- title: Sample Posts
|
||||||
|
url: /posts/
|
||||||
|
|
||||||
|
- title: Theme Setup
|
||||||
|
url: /theme-setup/
|
||||||
|
|
||||||
|
- title: Made Mistakes
|
||||||
|
url: http://mademistakes.com
|
|
@ -5,9 +5,14 @@
|
||||||
<div class="top-navigation">
|
<div class="top-navigation">
|
||||||
<nav role="navigation" id="site-nav" class="nav">
|
<nav role="navigation" id="site-nav" class="nav">
|
||||||
<ul>
|
<ul>
|
||||||
{% for link in site.links %}
|
{% for link in site.data.navigation %}
|
||||||
<li><a href="{% if link.external %}{{ link.url }}{% else %}{{ site.url }}{{ link.url }}{% endif %}" {% if link.external %}target="_blank"{% endif %}>{{ link.title }}</a></li>
|
{% if link.url contains 'http' %}
|
||||||
{% endfor %}
|
{% assign domain = '' %}
|
||||||
|
{% else %}
|
||||||
|
{% assign domain = site.url %}
|
||||||
|
{% endif %}
|
||||||
|
<li><a href="{{ domain }}{{ link.url }}" {% if link.url contains 'http' %}target="_blank"{% endif %}>{{ link.title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div><!-- /.top-navigation -->
|
</div><!-- /.top-navigation -->
|
||||||
|
|
Loading…
Reference in a new issue