Skip to content

Commit

Permalink
Merge pull request jekyll#52 from Crunch09/header_pages_config
Browse files Browse the repository at this point in the history
add `header_pages` config to link only specific files in header
  • Loading branch information
benbalter authored Apr 7, 2017
2 parents bcabdbd + d4f35ba commit 55ff779
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<header class="site-header" role="banner">

<div class="wrapper">

<a class="site-title" href="{{ "/" | relative_url}}">{{ site.title | escape }}</a>
{% assign default_paths = site.pages | map: "path" %}
{% assign page_paths = site.header_pages | default: default_paths %}
<a class="site-title" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>

<nav class="site-nav">
<span class="menu-icon">
Expand All @@ -14,7 +15,8 @@
</span>

<div class="trigger">
{% for my_page in site.pages %}
{% for path in page_paths %}
{% assign my_page = site.pages | where: "path", path | first %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
{% endif %}
Expand Down
5 changes: 5 additions & 0 deletions example/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ baseurl: "/minima"
twitter_username: jekyllrb
github_username: jekyll

# If you want to link only specific pages in your header, uncomment
# this and add the path to the pages in order as they should show up
#header_pages:
# - about.html

# Build settings
markdown: kramdown
theme: minima
Expand Down

0 comments on commit 55ff779

Please sign in to comment.