Add configurable external links to top navigation. Resolves #9

This commit is contained in:
Michael Rose 2013-06-30 15:03:50 -04:00
parent b4cfc8f291
commit dc33992fea
4 changed files with 14 additions and 4 deletions

View file

@ -76,7 +76,7 @@ Your Google Analytics ID goes here along with meta tags for [Google Webmaster To
#### Top Navigation Links #### Top Navigation Links
Edit page/post titles and URLs to include in the site's navigation. If you want to add links to other sites you can hardcode them into `navigation.html`. Edit page/post titles and URLs to include in the site's navigation. For external links add `external: true`.
``` yaml ``` yaml
# sample top navigation links # sample top navigation links
@ -87,6 +87,9 @@ links:
url: /articles url: /articles
- title: Other Page - title: Other Page
url: /other-page url: /other-page
- title: External Link
url: http://mademistakes.com
external: true
``` ```
#### Other Stuff #### Other Stuff

View file

@ -26,7 +26,8 @@ google_verify: UQj93ERU9zgECodaaXgVpkjrFn9UrDMEzVamacSoQ8Y
# 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: D81F4C18A6CB3018F64D7C827D953DFD bing_verify: D81F4C18A6CB3018F64D7C827D953DFD
# Internal pages/posts to include in top navigation # Links to include in top navigation
# For external links add external: true
links: links:
- title: About - title: About
url: /about url: /about
@ -34,6 +35,9 @@ links:
url: /articles url: /articles
- title: Theme Setup - title: Theme Setup
url: /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

View file

@ -2,7 +2,7 @@
<nav role="navigation" id="site-nav" class="animated fadeInDown" itemscope itemtype="http://schema.org/SiteNavigationElement"> <nav role="navigation" id="site-nav" class="animated fadeInDown" itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul> <ul>
{% for link in site.links %} {% for link in site.links %}
<li><a href="{{ site.url }}{{ link.url }}">{{ link.title }}</a></li> <li><a href="{% if link.external %}{{ link.url }}{% else %}{{ site.url }}{{ link.url }}{% endif %}" {% if link.external %}target="_blank"{% endif %}>{{ link.title }}</a></li>
{% endfor %} {% endfor %}
<li><i class="icon-rss"></i> <a href="{{ site.url }}/feed.xml" title="Atom/RSS feed">Feed</a> <li><i class="icon-rss"></i> <a href="{{ site.url }}/feed.xml" title="Atom/RSS feed">Feed</a>
</ul> </ul>

View file

@ -68,7 +68,7 @@ Your Google Analytics ID goes here along with meta tags for [Google Webmaster To
#### Top Navigation Links #### Top Navigation Links
Edit page/post titles and URLs to include in the site's navigation. If you want to add links to other sites you can hardcode them into `navigation.html`. Edit page/post titles and URLs to include in the site's navigation. For external links add `external: true`.
{% highlight yaml %} {% highlight yaml %}
# sample top navigation links # sample top navigation links
@ -79,6 +79,9 @@ links:
url: /articles url: /articles
- title: Other Page - title: Other Page
url: /other-page url: /other-page
- title: External Link
url: http://mademistakes.com
external: true
{% endhighlight %} {% endhighlight %}
#### Other Stuff #### Other Stuff