Avoid multiple menu entries with Jekyll pagination

paginate v2 jekyll
github jekyll paginate v2
gem jekyll-paginate-v2
pagination-v2
pagination generator
jekyll paginator v2
could not find jekyll-paginate-v2-2.1.0 in any of the sources
jekyll plugin order

I'm using Jekyll paginate plugin to create multiple pages for my blog. To make sure pagination works I have created a separate directory called blog with an index.html file. In the front matter of this index.html file I specify the layout, title and order:

---
layout: default
title:  Blog
order:  8
---

The title value is picked up by Jekyll and used to create a menu entry called "Blog" on the main page of my website. However, once pagination is enabled and all the posts are split into multiple pages, each page will have a title "Blog". This will result in multiple menu entries "Blog". I would like to have only one menu item call "Blog".

I have tried to reset the page title to "empty" for additional pages created by paginator by inserting this code into the index.html:

{% if paginator.page > 1 %}
  {% assign page.title = '' %}
{% endif %}

It seems page.title is not a variable, but an object. Therefore, the assignment was not effective.

Allo, I don't think you can change the title from the paginator.page.title or from page.title even if you assign it ''.

In my case to fix the issue, I changed the way the title were rendered in the navbar by making sure they were not repeated twice.

    {% assign name_page = "" %}
    {% for page in site.pages %}
    {% if name_page contains page.title %}
    <!-- do nothing if already there -->
    {% else %}
      <li class="separator"> | </li>
      <li>
          <a class="clear" href="{{ page.url | relative_url }}">
            {{ page.title }}
          </a>
      </li>
    {% endif %}
    {% assign name_page = page.title | append: name_page %}
    {% endif %}
    {% endfor %} 

So basically it adds the title to name_page and if the title is there twice it does not print the page title.

Avoid multiple menu entries with Jekyll pagination, How about turning it around, so checking paginator.page < 2 while building your menu? Seems like a more logical solution to me. 4 Avoid multiple menu entries with Jekyll pagination Dec 21 '17 3 How to Generate a calling graph for C++ code Jul 3 '14 2 Managing dynamically allocatable arrays inside a custom structure Oct 25 '18

How about turning it around, so checking paginator.page < 2 while building your menu? Seems like a more logical solution to me.

Autopages won't work with tags that include special characters e.g + , I'm using Jekyll paginate plugin to create multiple pages for my blog. To make sure pagination works I have created a separate directory called blog with an  Jekyll::Paginate::Multiple. Uses jekyll-paginate for the pagination, but allows to paginate multiple blogs. Installation gem install jekyll-paginate-multiple Usage. The posts of the different blogs must be in their own directories in _posts/. Each directory has it's own pagination configuration. Config example. Example of _config.yml file

I discriminate on pagination url, which are /blog/, /blog/page1/, .... And I only print pages that doesn't contains 'page'.

{%- for p in pages -%}
  {%- unless p.url contains 'page' -%}
    <li><a href="{{ site.baseurl }}{{ p.url }}">{{ p.title }}</a></li>
  {%- endunless -%}
{% endfor %}

Pagination, https://github.com/sverrirs/jekyll-paginate-v2/blob/master/examples/03-tags/_ element to disable categories: # Optional, the title that each category paginate page <div class="col-lg-3 col-md-3 sidebar mobile-hidden"> <div class="​container menu"> <! e.g. temporarily set Gemfile entry as follows: Recently I updated the Scott Logic blog to implement infinite scrolling using a combination of Jekyll pagination and jScroll. Both of these components are quite fussy about their respective configuration, meaning that integrating them took longer than expected. I thought I'd share my solution in this blog post, hopefully saving others from the hours I spent digging into jScroll code or cursing

you could also use unless control flow tag which is the opposite of if like this

{% assign tempPage = "" %}
{% for page in site.pages %}
   {% unless tempPage contains page.title %}
      {% comment %} list out the pages {% endcomment %}
      {{ page.title }}
   {% endunless %}
   {% assign tempPage = page.title | append: tempPage %}
{% endfor %}

here we append all the previously listed page.title to tempPage and the pages will get listed out only if the tempPage does not contain the current page's title in the loop

Layouts - Minimal Mistakes, To enable pagination for posts on your blog, add a line to the _config.yml file that specifies how many items should be displayed per page: paginate: 5. Pagination. With many websites — especially blogs — it’s very common to break the main listing of posts up into smaller lists and display them over multiple pages. Jekyll offers a pagination plugin, so you can automatically generate the appropriate files and folders you need for paginated listings.

Multilingual Mode, A Jekyll layout that compresses HTML in pure Liquid. To enable To change to a grid view add entries_layout: grid to the page's front matter. It is built to show a paginated list of recent posts based off of the pagination settings in _config.yml . In the case of the theme's documentation menu I used docs . Single-page view, pager, SEO support, self-adjusting links, multipage-aware Table Of Contents. - ibrado/jekyll-paginate-content Paginate::Content - Split your Jekyll pages, posts, etc. into multiple pages automatically.

core-services / jekyll-theme-lcsb-default, Avoid multiple menu entries with Jekyll pagination. Another elegant solution is to remove duplicate entries while sorting site pages by order. This can be  Jekyll::StickyPosts. StickyPosts is a plugin for Jekyll that sticks/pins posts marked sticky: true to the top, i.e. it moves them before all others. Optionally, the posts could also appear where they normally would.

Hugo supports the creation of websites with multiple languages side by side. Note that you cannot disable the default content language. Without it, menu entries in all languages would link to the English version, since it's Menu Templates · Pagination · RSS Templates · Sitemap Template · Robots.txt  Instead of hard-coding navigation links, you can programmatically retrieve a list of pages to build the navigation for your site. Although there’s already information about interacting with data files in other Jekyll docs, this tutorial dives into building more robust navigation for your site.