Skip to content

Commit

Permalink
Documentation: add submenu for training
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelcarmena committed Apr 5, 2021
1 parent 7a02beb commit 9975019
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
12 changes: 9 additions & 3 deletions arrow-site/docs/_data/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ nav:
- title: Media
url: https://media.arrow-kt.io

- title: Training
url: https://www.47deg.com/trainings/

- title: Support
url: https://www.47deg.com/services/

- title: Training
submenu:

- title: 47 Degrees
url: https://www.47deg.com/trainings/

- title: Instil
url: https://instil.co/courses/functional-programming-in-kotlin-with-arrow/

- title: Github
url: https://github.com/arrow-kt/arrow

Expand Down
11 changes: 10 additions & 1 deletion arrow-site/docs/_includes/_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
{% for item in site.data.menu.nav%}
{% if item.title != 'Github' %}
<li class="nav-menu-item">
<a class="menu-links" href="{{ item.url }}" title="{{ item.title }}">{{ item.title }}</a>
<a class="menu-links {% if item.submenu %}no-hover{% endif %}" {% if item.url %}href="{{ item.url }}"{% endif %} title="{{ item.title }}">{{ item.title }}</a>
{% if item.submenu %}
<ul class="nav-submenu">
{% for submenu-item in item.submenu %}
<li class="nav-submenu-item">
<a class="menu-links" href="{{ submenu-item.url }}" title="{{ submenu-item.title }}">{{ submenu-item.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
Expand Down
37 changes: 37 additions & 0 deletions arrow-site/docs/_sass/components/home/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@
margin-right: ($base-point-grid * 5);
}

.nav-submenu {
display: none;
position: absolute;

&-item {
padding-top: $base-point-grid;

&::before {
content: "-";
}
}
}

.menu-links {
padding-bottom: 4px;
text-transform: uppercase;
Expand All @@ -105,6 +118,16 @@
}
}
}

.no-hover {
pointer-events: none;
}

&:hover {
.nav-submenu {
display: block;
}
}
}
}
}
Expand Down Expand Up @@ -164,6 +187,20 @@
&:not(:last-child) {
margin-right: 0;
}

.nav-submenu {
position: relative;
display: block;

&-item {
padding-top: ($base-point-grid * 2);
padding-left: ($base-point-grid * 2);

&::before {
content: "-";
}
}
}
}

.nav-stars {
Expand Down

0 comments on commit 9975019

Please sign in to comment.