Skip to content

Commit

Permalink
updated header
Browse files Browse the repository at this point in the history
  • Loading branch information
maldosari1 committed Mar 18, 2024
1 parent f5308f1 commit ef3e36f
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ announcements:
limit: 5 # leave blank to include all the news in the `_news` folder

latest_posts:
enabled: true
enabled: false
scrollable: true # adds a vertical scroll bar if there are more than 3 new posts items
limit: 3 # leave blank to include all the blog posts

Expand Down
64 changes: 64 additions & 0 deletions _includes/header.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,70 @@
{% endif %}
</a>
</li>

<!-- Other pages -->
{% assign sorted_pages = site.pages | sort: 'nav_order' %}
{% for p in sorted_pages %}
{% if p.nav and p.autogen == null %}
{% if p.dropdown %}
{% assign has_active_child = false %}
{% for child in p.children %}
{% if page.title == child.title %}
{% assign has_active_child = true %}
{% endif %}
{% endfor %}
<li class="nav-item dropdown {% if page.title == p.title or has_active_child %}active{% endif %}">
<a
class="nav-link dropdown-toggle"
href="#"
id="navbarDropdown"
role="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
{{- p.title }}
{% if page.title == p.title or has_active_child %}
<span class="sr-only">(current)</span>
{% endif %}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
{% for child in p.children %}
{% if child.title == 'divider' %}
<div class="dropdown-divider"></div>
{% else %}
<a class="dropdown-item {% if page.title == child.title %}active{% endif %}" href="{{ child.permalink | relative_url }}">
{{- child.title -}}
</a>
{% endif %}
{% endfor %}
</div>
</li>
{% else %}
<li class="nav-item {% if page.url contains p.permalink %}active{% endif %}">
{% if p.permalink contains '/blog/' %}{% assign url = '/blog/' %} {% else %}{% assign url = p.url %}{% endif %}
<a class="nav-link" href="{{ url | relative_url }}">
{{- p.title }}
{% if page.url contains p.url %}
<span class="sr-only">(current)</span>
{% endif %}
</a>
</li>
{% endif %}
{% endif %}
{% endfor %}
{% if site.enable_darkmode %}
<!-- Toogle theme mode -->
<li class="toggle-container">
<button id="light-toggle" title="Change theme">
<i class="ti ti-sun-moon" id="light-toggle-system"></i>
<i class="ti ti-moon-filled" id="light-toggle-dark"></i>
<i class="ti ti-sun-filled" id="light-toggle-light"></i>
</button>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
{% if site.enable_progressbar %}
Expand Down

0 comments on commit ef3e36f

Please sign in to comment.