Skip to content

Commit 2c7ebcb

Browse files
committed
Fixed broken "Scala 3" sub menu on mobile
CSS doesn't support id selector containing whitespace, see https://github.com/scala/docs.scala-lang/blob/d626b36e217a99ee078cdcfbc30d23386dc7fb00/resources/js/functions.js#L90
1 parent d626b36 commit 2c7ebcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_includes/navbar-inner.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<li class="navigation-menu-item">
2424
{% capture translatedPageId %}/{{page.language}}{{navItem.url | remove_first: '.html' }}{% endcapture %}
2525
{% assign navItemTranslated = site.documents | where: 'id', translatedPageId | first %}
26-
<a href="{% if navItemTranslated.url %}{{navItemTranslated.url}}{% elsif navItem.url contains '://' or navItem.url == '#' %}{{navItem.url}}{% else %}{{site.baseurl}}{{navItem.url}}{% endif %}" id="{{ navItem.title | downcase | strip }}" {% if page.url contains navItem.url %}class="active"{% endif %}>{{navItem.title}}</a>
26+
<a href="{% if navItemTranslated.url %}{{navItemTranslated.url}}{% elsif navItem.url contains '://' or navItem.url == '#' %}{{navItem.url}}{% else %}{{site.baseurl}}{{navItem.url}}{% endif %}" id="{{ navItem.title | downcase | strip | remove: ' ' }}" {% if page.url contains navItem.url %}class="active"{% endif %}>{{navItem.title}}</a>
2727
{% if navItem.submenu %}
2828
<ul class="navigation-dropdown">
2929
{% for subItem in navItem.submenu %}
@@ -42,7 +42,7 @@
4242
<nav class="doc-navigation-submenus">
4343
{% for navItem in navdata %}
4444
{% if navItem.submenu %}
45-
<ul class="navigation-submenu" id="{{ navItem.title | downcase | strip }}" style="display: none;">
45+
<ul class="navigation-submenu" id="{{ navItem.title | downcase | strip | remove: ' ' }}" style="display: none;">
4646
{% for subItem in navItem.submenu %}
4747
<li>
4848
<a href="{% if subItem.url contains '://' %}{{subItem.url}}{% else %}{{site.baseurl}}{{subItem.url}}{% endif %}">{{ subItem.title }}</a>

0 commit comments

Comments
 (0)