diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-06-25 07:17:43 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-06-25 07:17:43 +0300 |
commit | 4723776beee0ac571d826e8598e8ec3a5359729b (patch) | |
tree | 008d118c56a86fb2240c3706829a14b43e046477 /posts | |
parent | fix post pagination links (diff) | |
download | sorting-algorithms-4723776beee0ac571d826e8598e8ec3a5359729b.tar.gz sorting-algorithms-4723776beee0ac571d826e8598e8ec3a5359729b.zip |
fix navbar links with multiple pages
I determine whether a page should be present in the navigation bar by
checking if 'navbar' is present in this page's `groups`.
My posts/index.html is an example of such page.
But `jekyll-paginate` creates a bunch of similar pages, each of them
having 'navbar' in their `groups`.
Thus, every /posts//pageN appears in the navbar.
To get rid of all of them except for the first one, I set `root_page` to
`true` in index.html, and only include the first page with `root_page ==
true` in the navbar.
Man, it's a hack if I've ever seen one.
Diffstat (limited to 'posts')
-rw-r--r-- | posts/index.html | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/posts/index.html b/posts/index.html index fb21dbf..fb91205 100644 --- a/posts/index.html +++ b/posts/index.html @@ -4,6 +4,7 @@ layout: sidebar groups: - navbar navbar_link: <span class="glyphicon glyphicon-th-list"></span> Posts +root_page: true --- {% if site.posts.size == 0 %} <p class="h3">Sorry, no posts have been added yet.</p> |