-
Seems the default "About", "Blogs", "Projects", "Publications" are in alphabet order, how do I make it such as "Blogs", "About", "Nancy", "Information" ? Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
mbarbetti
Jul 20, 2021
Replies: 1 comment 3 replies
-
The order of the sections in the navbar is set in header.html. <!-- About -->
<li class="nav-item {% if page.title == 'about' %}active{% endif %}">
<a class="nav-link" href="{{ '/' | relative_url }}">
about
{% if page.title == "about" %}
<span class="sr-only">(current)</span>
{% endif %}
</a>
</li> Then blog (see from line 34): {% if site.blog_name %}
<!-- Blog -->
<li class="nav-item {% if page.url contains 'blog' %}active{% endif %}">
<a class="nav-link" href="{{ '/blog/' | relative_url }}">
blog
{% if page.title == "blog" %}
<span class="sr-only">(current)</span>
{% endif %}
</a>
</li>
{% endif %} And finally the rest of pages in alphabet order (see from line 45): <!-- Other pages -->
{% assign sorted_pages = site.pages | sort: "title" %}
{% for p in sorted_pages %}
{% if p.nav and p.autogen == nil %}
<li class="nav-item {% if page.title == p.title %}active{% endif %}">
<a class="nav-link" href="{{ p.url | relative_url }}">
{{ p.title }}
{% if page.title == p.title %}
<span class="sr-only">(current)</span>
{% endif %}
</a>
</li>
{% endif %}
{% endfor %} If you want to change the order of the sections, you should simply reorder these blocks of code how you prefer! |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
zeyunlu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The order of the sections in the navbar is set in header.html.
Actually the first section is about (see from line 25):
Then blog (see from line 34):