Add configurable external links to top navigation. Resolves #5

This commit is contained in:
Michael Rose 2013-06-30 15:34:46 -04:00
parent ed5062c9fd
commit 8e94928183
4 changed files with 39 additions and 4 deletions

View file

@ -68,7 +68,7 @@ Your Google Analytics ID goes here along with meta tags for [Google Webmaster To
#### 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
# sample top navigation links
@ -79,6 +79,9 @@ links:
url: /articles
- title: Other Page
url: /other-page
- title: External Page
url: http://mademistakes.com
external: true
```
#### Other Stuff

View file

@ -27,7 +27,8 @@ google_verify: UQj93ERU9zgECodaaXgVpkjrFn9UrDMEzVamacSoQ8Y
# https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here
bing_verify: D81F4C18A6CB3018F64D7C827D953DFD
# Internal pages/posts to include in top navigation
# Links to include in top navigation
# For external links add external: true
links:
- title: About
url: /about
@ -35,6 +36,9 @@ links:
url: /articles
- 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
timezone: America/New_York

View file

@ -6,7 +6,7 @@
<nav role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul>
{% 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 %}
<li><i class="icon-feed"></i> <a href="{{ site.url }}/feed.xml" title="Atom/RSS feed">Feed</a>
</ul>

View file

@ -60,7 +60,35 @@ minimal-mistakes/
### _config.yml
Variables you want to update are: site name, description, url[^1], owner info, and your Google Anayltics tracking id and webmaster tool verifications. Most of these variables are used in the .html files found in *_includes* if you need to add or remove anything.
Most of the variables found here are used in the .html files found in `_includes` if you need to add or remove anything. A good place to start would be to change the title, tagline, description, and url of your site. When working locally comment out `url` or else you will get a bunch of broken links because they are absolute and prefixed with `{{ site.url }}` in the various `_includes` and `_layouts`. Just remember to uncomment `url` when building for deployment or pushing to **gh-pages**...
#### Owner/Author Information
Change your name, bio, and avatar photo (100x100 pixels or larger), Twitter url, email, and Google+ url. If you want to link to an external image on Gravatar or something similiar you'll need to edit the path in `author-bio.html` since it assumes it is located in `\images`.
Including a link to your Google+ profile has the added benefit of displaying [Google Authorship](https://plus.google.com/authorship) in Google search results if you've went ahead and applied for it. Don't have a Google+ account? Just leave it blank and/or remove `<link rel="author" href="{{ site.owner.google_plus }}">` from `head.html`.
#### Google Analytics and Webmaster Tools
Your Google Analytics ID goes here along with meta tags for [Google Webmaster Tools](http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35179) and [Bing Webmaster Tools](https://ssl.bing.com/webmaster/configure/verify/ownershi) site verification.
#### Top Navigation Links
Edit page/post titles and URLs to include in the site's navigation. For external links add `external: true`.
{% highlight yaml %}
# sample top navigation links
links:
- title: About Page
url: /about
- title: Articles
url: /articles
- title: Other Page
url: /other-page
- title: External Page
url: http://mademistakes.com
external: true
{% endhighlight %}
### Adding Posts and Pages