How to Exclude Pages From Jekyll Navigation Menu – Minima Theme

Simple and easy method to exclude pages from main navigation menu in your defauly jekyll theme Minima.

Jekyll is a static website generator. It makes is very simple and easy to create small static websites and blogs.

If you are using default Jekyll theme Minima, it will add new page link dynamically to main navigation menu in your header menu.

If you want to exclude some pages from default/main navigation menu you need to customize your Header.html file. which you can find in _excludes directory. If you have install Minima theme locally on your machine.

Open header.html file and you will find this code under trigger class.

{% for my_page in site.pages %}
          {% if my_page.title %}
          {{ my_page.title | escape }}
          {% endif %}
        {% endfor %}

Replace above code with following code.

{% for page in site.pages %}
          {% unless page.exclude %}
             {% if page.title %}
               {{ page.title }}
             {% endif %}
          {% endunless %}
        {% endfor %}

Now create a new page on your Jekyll site and use exclude: true to exclude page from navigation menu.

layout: page
title: NameCheap Shared Hosting
permalink: /shared-hosting/
exclude: true


I found this soloution at stackoverflow

Leave a Reply

Your email address will not be published. Required fields are marked *