Skip to content

Commit a527bfd

Browse files
committedApr 25, 2020
Allow empty menu items
1 parent 75695df commit a527bfd

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed
 

‎_config.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
# See: https://theme-next.org/docs/theme-settings/
44
# ---------------------------------------------------------------
55

6-
# If false, merge configs from `_data/next.yml` into default configuration (rewrite).
7-
# If true, will fully override default configuration by options from `_data/next.yml` (override). Only for NexT settings.
8-
# And if true, all config from default NexT `_config.yml` have to be copied into `next.yml`. Use if you know what you are doing.
9-
# Useful if you want to comment some options from NexT `_config.yml` by `next.yml` without editing default config.
10-
override: false
11-
126
# Console reminder if new version released.
137
reminder: false
148

@@ -116,11 +110,11 @@ darkmode: false
116110
# When running the site in a subdirectory (e.g. yoursite.com/blog), remove the leading slash from link value (/archives -> archives).
117111
# External url should start with http:// or https://
118112
menu:
119-
home: / || fa fa-home
113+
#home: / || fa fa-home
120114
#about: /about/ || fa fa-user
121115
#tags: /tags/ || fa fa-tags
122116
#categories: /categories/ || fa fa-th
123-
archives: /archives/ || fa fa-archive
117+
#archives: /archives/ || fa fa-archive
124118
#schedule: /schedule/ || fa fa-calendar
125119
#sitemap: /sitemap.xml || fa fa-sitemap
126120
#commonweal: /404/ || fa fa-heartbeat

‎layout/_partials/header/brand.njk

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<div class="site-brand-container">
22
<div class="site-nav-toggle">
33
<div class="toggle" aria-label="{{ __('accessibility.nav_toggle') }}">
4-
<span class="toggle-line toggle-line-first"></span>
5-
<span class="toggle-line toggle-line-middle"></span>
6-
<span class="toggle-line toggle-line-last"></span>
4+
{%- if theme.menu %}
5+
<span class="toggle-line toggle-line-first"></span>
6+
<span class="toggle-line toggle-line-middle"></span>
7+
<span class="toggle-line toggle-line-last"></span>
8+
{%- endif %}
79
</div>
810
</div>
911

‎layout/_partials/header/menu.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% import 'menu-item.njk' as menu_item with context %}
22

3-
<nav class="site-nav">
43
{%- if theme.menu %}
4+
<nav class="site-nav">
55
<ul id="menu" class="main-menu menu">
66
{%- for name, path in theme.menu %}
77
{%- set respath = path %}
@@ -30,5 +30,5 @@
3030
</li>
3131
{%- endif %}
3232
</ul>
33-
{%- endif %}
3433
</nav>
34+
{%- endif %}

‎source/js/next-boot.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ NexT.boot.registerEvents = function() {
1111
document.querySelector('.site-nav-toggle .toggle').addEventListener('click', () => {
1212
event.currentTarget.classList.toggle('toggle-close');
1313
var siteNav = document.querySelector('.site-nav');
14+
if (!siteNav) return;
1415
var animateAction = siteNav.classList.contains('site-nav-on') ? 'slideUp' : 'slideDown';
1516

1617
if (typeof Velocity === 'function') {

0 commit comments

Comments
 (0)
Please sign in to comment.