Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iteration on /core-nodes nav #1145

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions src/_includes/layouts/left-nav-core-nodes.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!-- Navigation -->
<div class="border-r" data-{{nav}}>
<ul class="handbook-nav" data-el="navigation">
{% set path = (["node-red/", nav] | join) if nav == "core-nodes" else nav %}

<li class="core-nodes-nav-group py-1.5 px-0 {% if "/{{ path }}/" === page.url %}active{% endif %}">
<a href="/{{ path }}/"><span class="text-red-600 pr-0">{{ nav }}</span></a>
</li>
{% for group in collections
.nav[nav]
.groups %}
{% if group.children.length > 0 %}
<li class="handbook-nav-nested py-1.5"><span class="font-semibold pl-2">{{ group.name }}</span>
<button onclick="toggleNavList(this)">
<span class="ff-icon icon-expand">
{% include "components/icons/chevron-down.svg" %}
</span>
<span class="ff-icon icon-minimise">
{% include "components/icons/chevron-up.svg" %}
</span>
</button>
</li>
<ul class="handbook-nav-nested">
{% for entry in group.children %}
<li class="{% if entry.url === page.url %}active{% endif %}">
<a href="{{entry.url}}">
{{ entry.name }}
</a>
{% if entry.children %}
<button onclick="toggleNavList(this)">
<span class="ff-icon icon-expand">
{% include "components/icons/chevron-down.svg" %}
</span>
<span class="ff-icon icon-minimise">
{% include "components/icons/chevron-up.svg" %}
</span>
</button>
{% endif %}
</li>
{% if entry.children %}
<ul class="handbook-nav-nested-2">
{% for child in entry.children %}
<li class="{% if child.url === page.url %}active{% endif %}">
<a href="{{child.url}}">
{{ child.name }}
</a>
{% if child.children %}
<button onclick="toggleNavList(this)">
<span class="ff-icon icon-expand">
{% include "components/icons/chevron-down.svg" %}
</span>
<span class="ff-icon icon-minimise">
{% include "components/icons/chevron-up.svg" %}
</span>
</button>
{% endif %}
</li>
{% if child.children %}
<ul class="handbook-nav-nested-2">
{% for grandchild in child.children %}
<li class="{% if grandchild.url === page.url %}active{% endif %}">
<a href="{{grandchild.url}}">
{{ grandchild.name }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
</div>
14 changes: 7 additions & 7 deletions src/_includes/layouts/node-docs.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: nohero
date: git Last Modified
---
<script>
function toggleNavList (el) {
function toggleNavList(el) {
const li = el.parentElement
li.classList.toggle('open')
const ul = li.nextElementSibling
Expand All @@ -15,12 +15,12 @@ date: git Last Modified
ul.parentElement.style.maxHeight = "initial"
}
ul.style.maxHeight = ul.scrollHeight + "px";
}
}
}
</script>

<div class="handbook ff-prose text-left pb-24 md:max-w-screen-xl m-auto">
{% include "./left-nav.njk" %}
{% include "./left-nav-core-nodes.njk" %}

<div class="max-w-screen-lg mx-auto px-8 pt-8">
<!-- Breadcrumbs - Desktop -->
Expand Down Expand Up @@ -57,11 +57,11 @@ date: git Last Modified
<!-- Right side bar -->
<div class="sticky top-6 w-full md:w-64 mt-4 md:mt-6 px-8">
{%- for maintainer in page | pageOwners | ghUsersToTeamMembers(team) -%}
{%- if loop.first -%}
<h3 class="font-medium border-b pb-1 mb-4">Page maintainer</h3>
{%- endif -%}
{%- if loop.first -%}
<h3 class="font-medium border-b pb-1 mb-4">Page maintainer</h3>
{%- endif -%}

{% renderTeamMember maintainer %}
{% renderTeamMember maintainer %}
{%- endfor -%}
<div class="text-sm pb-1 text-right mb-4"><a href="{{ page | handbookEditLink }}">Edit this page</a></div>
<div class="text-xs pb-1 text-right mb-4 italic">Updated: {{ page.date | shortDate }}</div>
Expand Down
13 changes: 13 additions & 0 deletions src/css/style.handbook.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@
background-color: theme(colors.gray.200);
}

/* .handbook-nav li a:active {
background-color: theme(colors.gray.200);
} */

.handbook-nav li.core-nodes-nav-group a:hover,
.handbook-nav li.core-nodes-nav-group a {
color: theme(colors.red.600);
text-decoration: none;
}

/* .handbook-nav li.core-nodes-nav-group.active {
background-color: theme(colors.gray.100);
} */

.handbook li .icon-expand {
display: block;
Expand Down