|
42 | 42 |
|
43 | 43 | <div class="collapse navbar-collapse text-right" id="navbarNav">
|
44 | 44 | <ul class="navbar-nav ml-auto flex-nowrap">
|
45 |
| - <!-- Other pages --> |
46 |
| - {% assign sorted_pages = site.pages | sort: 'nav_order' %} |
47 |
| - {% for p in sorted_pages %} |
48 |
| - {% unless p.permalink == '/index.html' %} |
49 |
| - {% if p.nav and p.autogen == null %} |
50 |
| - <!-- Existing logic for other pages --> |
51 |
| - {% if p.dropdown %} |
52 |
| - <!-- Dropdown logic --> |
53 |
| - {% assign has_active_child = false %} |
54 |
| - {% for child in p.children %} |
55 |
| - {% if page.title == child.title %} |
56 |
| - {% assign has_active_child = true %} |
57 |
| - {% endif %} |
58 |
| - {% endfor %} |
59 |
| - <li class="nav-item dropdown {% if page.title == p.title or has_active_child %}active{% endif %}"> |
60 |
| - <a |
61 |
| - class="nav-link dropdown-toggle" |
62 |
| - href="#" |
63 |
| - id="navbarDropdown" |
64 |
| - role="button" |
65 |
| - data-toggle="dropdown" |
66 |
| - aria-haspopup="true" |
67 |
| - aria-expanded="false" |
68 |
| - > |
69 |
| - {{- p.title }} |
70 |
| - {% if page.title == p.title or has_active_child %} |
71 |
| - <span class="sr-only">(current)</span> |
72 |
| - {% endif %} |
73 |
| - </a> |
74 |
| - <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> |
75 |
| - {% for child in p.children %} |
76 |
| - {% if child.title == 'divider' %} |
77 |
| - <div class="dropdown-divider"></div> |
78 |
| - {% else %} |
79 |
| - <a class="dropdown-item {% if page.title == child.title %}active{% endif %}" href="{{ child.permalink | relative_url }}"> |
80 |
| - {{- child.title -}} |
81 |
| - </a> |
82 |
| - {% endif %} |
83 |
| - {% endfor %} |
84 |
| - </div> |
85 |
| - </li> |
86 |
| - {% else %} |
87 |
| - {% assign parent_link = p.permalink | remove: 'index.html' %} |
88 |
| - <li class="nav-item {% if page.url contains parent_link %}active{% endif %}"> |
89 |
| - <a class="nav-link" href="{{ p.url | relative_url }}"> |
90 |
| - {{- p.title }} |
91 |
| - {% if page.url contains p.url %} |
92 |
| - <span class="sr-only">(current)</span> |
93 |
| - {% endif %} |
94 |
| - </a> |
95 |
| - </li> |
96 |
| - {% endif %} |
97 |
| - {% endif %} |
98 |
| - {% endunless %} |
| 45 | + {% for page in site.pages %} |
| 46 | + {% if page.permalink == '/' %} {% assign about_title = page.title %} {% endif %} |
99 | 47 | {% endfor %}
|
100 | 48 |
|
101 |
| - <!-- Home/blog Page --> |
| 49 | + <!-- About --> |
102 | 50 | <li class="nav-item {% if page.permalink == '/' %}active{% endif %}">
|
103 | 51 | <a class="nav-link" href="{{ '/' | relative_url }}">
|
104 |
| - blog |
| 52 | + {{- about_title }} |
105 | 53 | {% if page.permalink == '/' %}
|
106 | 54 | <span class="sr-only">(current)</span>
|
107 | 55 | {% endif %}
|
108 | 56 | </a>
|
109 | 57 | </li>
|
| 58 | + |
| 59 | + <!-- Other pages --> |
| 60 | + {% assign sorted_pages = site.pages | sort: 'nav_order' %} |
| 61 | + {% for p in sorted_pages %} |
| 62 | + {% if p.nav and p.autogen == null %} |
| 63 | + {% if p.dropdown %} |
| 64 | + {% assign has_active_child = false %} |
| 65 | + {% for child in p.children %} |
| 66 | + {% if page.title == child.title %} |
| 67 | + {% assign has_active_child = true %} |
| 68 | + {% endif %} |
| 69 | + {% endfor %} |
| 70 | + <li class="nav-item dropdown {% if page.title == p.title or has_active_child %}active{% endif %}"> |
| 71 | + <a |
| 72 | + class="nav-link dropdown-toggle" |
| 73 | + href="#" |
| 74 | + id="navbarDropdown" |
| 75 | + role="button" |
| 76 | + data-toggle="dropdown" |
| 77 | + aria-haspopup="true" |
| 78 | + aria-expanded="false" |
| 79 | + > |
| 80 | + {{- p.title }} |
| 81 | + {% if page.title == p.title or has_active_child %} |
| 82 | + <span class="sr-only">(current)</span> |
| 83 | + {% endif %} |
| 84 | + </a> |
| 85 | + <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> |
| 86 | + {% for child in p.children %} |
| 87 | + {% if child.title == 'divider' %} |
| 88 | + <div class="dropdown-divider"></div> |
| 89 | + {% else %} |
| 90 | + <a class="dropdown-item {% if page.title == child.title %}active{% endif %}" href="{{ child.permalink | relative_url }}"> |
| 91 | + {{- child.title -}} |
| 92 | + </a> |
| 93 | + {% endif %} |
| 94 | + {% endfor %} |
| 95 | + </div> |
| 96 | + </li> |
| 97 | + {% else %} |
| 98 | + {% assign parent_link = p.permalink | remove: 'index.html' %} |
| 99 | + <li class="nav-item {% if page.url contains parent_link %}active{% endif %}"> |
| 100 | + {% if p.permalink contains '/blog/' %}{% assign url = '/blog/' %} {% else %}{% assign url = p.url %}{% endif %} |
| 101 | + <a class="nav-link" href="{{ url | relative_url }}"> |
| 102 | + {{- p.title }} |
| 103 | + {% if page.url contains p.url %} |
| 104 | + <span class="sr-only">(current)</span> |
| 105 | + {% endif %} |
| 106 | + </a> |
| 107 | + </li> |
| 108 | + {% endif %} |
| 109 | + {% endif %} |
| 110 | + {% endfor %} |
| 111 | + {% if site.search_enabled %} |
| 112 | + <!-- Search --> |
| 113 | + <li class="nav-item"> |
| 114 | + <button id="search-toggle" title="Search" onclick="openSearchModal()"> |
| 115 | + <span class="nav-link">ctrl k <i class="ti ti-search"></i></span> |
| 116 | + </button> |
| 117 | + </li> |
| 118 | + {% endif %} |
| 119 | + {% if site.enable_darkmode %} |
| 120 | + <!-- Toogle theme mode --> |
| 121 | + <li class="toggle-container"> |
| 122 | + <button id="light-toggle" title="Change theme"> |
| 123 | + <i class="ti ti-sun-moon" id="light-toggle-system"></i> |
| 124 | + <i class="ti ti-moon-filled" id="light-toggle-dark"></i> |
| 125 | + <i class="ti ti-sun-filled" id="light-toggle-light"></i> |
| 126 | + </button> |
| 127 | + </li> |
| 128 | + {% endif %} |
110 | 129 | </ul>
|
111 | 130 | </div>
|
112 | 131 | </div>
|
|
0 commit comments