Skip to content

Commit

Permalink
Use data file for site navigation
Browse files Browse the repository at this point in the history
- Move menu nav links from _config.yml to \_data\navigation.yml
  • Loading branch information
unknown authored and unknown committed Oct 29, 2014
1 parent 2f13971 commit 31d147c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
9 changes: 0 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ google_verify:
# https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here
bing_verify:

# Links to include in top navigation
# For external links add external: true
links:
- title: Theme Setup
url: /theme-setup
- title: External Link
url: http://mademistakes.com
external: true

# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: America/New_York
future: true
Expand Down
7 changes: 7 additions & 0 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Menu navigation links

- title: Theme Setup
url: /theme-setup/

- title: External Link
url: http://mademistakes.com
9 changes: 8 additions & 1 deletion _includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ <h4>{{ site.owner.name }}</h4>
<li><a href="{{ site.url }}/tags/">All Tags</a></li>
</ul>
</li>
{% for link in site.links %}<li>{% if link.external %}<a href="{{ link.url }}" target="_blank">{{ link.title }}</a>{% else %}<a href="{{ site.url }}{{ link.url }}">{{ link.title }}</a>{% endif %}</li>{% endfor %}
{% for link in site.data.navigation %}
{% if link.url contains 'http' %}
{% 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><!-- /.dl-menu -->
</nav><!-- /.dl-menuwrapper -->
30 changes: 14 additions & 16 deletions theme-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,50 +126,48 @@ hpstr-jekyll-theme/

## Customization

### _config.yml

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 add the `title`, `description`, and `url` for your site. Links are absolute and prefixed with `{{ "{{ site.url " }}}}` in the various `_includes` and `_layouts`, so remember to properly set `url`[^1] to `http://localhost:4000` when developing locally.

#### Disqus Comments
### Disqus Comments

Create a [Disqus](http://disqus.com) account and change `disqus_shortname` in `_config.yml` to the Disqus *shortname* you just setup. To enable commenting on a post, add the following to its front matter:

{% highlight yaml %}
comments: true
{% endhighlight %}

#### Social Share Links
### Social Share Links

To enable Facebook, Twitter, and Google+ share links on a post or page, add the following to its front matter:

{% highlight yaml %}
share: true
{% endhighlight %}

#### Owner/Author Information
### Owner/Author Information

Change your name, and avatar photo (200x200 pixels or larger), email, and social networking URLs. If you want to link to an external image on Gravatar or something similar you'll need to edit the path in `head.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.

#### Google Analytics and Webmaster Tools
### 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.

#### Navigation Menu Links
### Navigation Links

Edit page/post titles and URLs to include in the site's navigation. For external links add `external: true`.
To add additional links in the drop down menu edit `_data/navigation.yml`. Use the following format to set the URL and title for as many links as you'd like. *External links will open in a new window.*

{% highlight yaml %}
# sample top navigation links
links:
- title: Other Page
url: /other-page/
- title: External Link
url: http://mademistakes.com
external: true
- title: Portfolio
url: /portfolio/

- title: Made Mistakes
url: http://mademistakes.com
{% endhighlight %}

---

#### Background Images

To utilize this "feature" just add the following YAML to a post's front matter. ([View demo](http://mmistakes.github.io/hpstr-jekyll-theme/background-image/))
Expand All @@ -187,7 +185,7 @@ If you want to set a background image for the entire site just add `background:

The rest is just your average Jekyll config settings. Nothing too crazy here...

### _includes
### Jekyll _includes

For the most part you can leave these as is since the author/owner details are pulled from `_config.yml`. That said you'll probably want to customize the copyright stuff in `footer.html` to your liking.

Expand Down

0 comments on commit 31d147c

Please sign in to comment.