Skip to content

Commit

Permalink
Allow empty menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Apr 25, 2020
1 parent 75695df commit a527bfd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
10 changes: 2 additions & 8 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
# See: https://theme-next.org/docs/theme-settings/
# ---------------------------------------------------------------

# If false, merge configs from `_data/next.yml` into default configuration (rewrite).
# If true, will fully override default configuration by options from `_data/next.yml` (override). Only for NexT settings.
# 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.
# Useful if you want to comment some options from NexT `_config.yml` by `next.yml` without editing default config.
override: false

# Console reminder if new version released.
reminder: false

Expand Down Expand Up @@ -116,11 +110,11 @@ darkmode: false
# When running the site in a subdirectory (e.g. yoursite.com/blog), remove the leading slash from link value (/archives -> archives).
# External url should start with http:// or https://
menu:
home: / || fa fa-home
#home: / || fa fa-home
#about: /about/ || fa fa-user
#tags: /tags/ || fa fa-tags
#categories: /categories/ || fa fa-th
archives: /archives/ || fa fa-archive
#archives: /archives/ || fa fa-archive
#schedule: /schedule/ || fa fa-calendar
#sitemap: /sitemap.xml || fa fa-sitemap
#commonweal: /404/ || fa fa-heartbeat
Expand Down
8 changes: 5 additions & 3 deletions layout/_partials/header/brand.njk
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="{{ __('accessibility.nav_toggle') }}">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
{%- if theme.menu %}
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
{%- endif %}
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions layout/_partials/header/menu.njk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% import 'menu-item.njk' as menu_item with context %}

<nav class="site-nav">
{%- if theme.menu %}
<nav class="site-nav">
<ul id="menu" class="main-menu menu">
{%- for name, path in theme.menu %}
{%- set respath = path %}
Expand Down Expand Up @@ -30,5 +30,5 @@
</li>
{%- endif %}
</ul>
{%- endif %}
</nav>
{%- endif %}
1 change: 1 addition & 0 deletions source/js/next-boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NexT.boot.registerEvents = function() {
document.querySelector('.site-nav-toggle .toggle').addEventListener('click', () => {
event.currentTarget.classList.toggle('toggle-close');
var siteNav = document.querySelector('.site-nav');
if (!siteNav) return;
var animateAction = siteNav.classList.contains('site-nav-on') ? 'slideUp' : 'slideDown';

if (typeof Velocity === 'function') {
Expand Down

0 comments on commit a527bfd

Please sign in to comment.