Q:

how to configure website menu in jekyll

I'm making a website on jekyll and I use this code for the menu:
{% for page in site.pages %}
<li><a href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a></li>
{% endfor %}

But it adds to my menu an empty item of home page, that I don't need:
<li><a href="/"></a></li>

How can I remove it?

A:

Original jekyll does :
{% for my_page in site.pages %}
  {% if my_page.title %}
  <a class="page-link" href="{{ my_page.url | prepend: site.baseurl }}">{{ my_page.title }}</a>
  {% endif %}
{% endfor %}

But your can test on any page variable.
If you want to discriminate page depending on a type, you can set a front matter variable like type: toto and then generate your menu like this :
{% for my_page in site.pages %}
  {% if my_page.type == 'toto' %}
  <a class="page-link" href="{{ my_page.url | prepend: site.baseurl }}">{{ my_page.title }}</a>
  {% endif %}
{% endfor %}

