-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: add Resources nav link * 2.2.1 * fix(docs): typo in grid styles and add nav for resources (#59) * fix(docs): typo in grid styles and add nav for resources * Update docs/_includes/base.njk Co-authored-by: Shawn Allen <[email protected]> Co-authored-by: Shawn Allen <[email protected]> * docs: reorder Resources link, tweak nav templates Co-authored-by: Jackson Flint-Gonzales <[email protected]>
- Loading branch information
Showing
5 changed files
with
58 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,5 @@ | ||
{% macro nav_link(url, deep=true) %} | ||
{% set node = url | node(collections.all) %} | ||
{% set children = node.data.page | children(collections.all) %} | ||
<div class="mb-20"> | ||
<a | ||
class="flex justify-center title-xs no-underline mb-20" | ||
href="{{ url }}" | ||
{% if node.data.page.url === page.url %} | ||
aria-current="page" | ||
{% endif %} | ||
> | ||
<div class="flex-auto">{{ node.data.title }}</div> | ||
<div> | ||
{% if deep and children.length %} | ||
<sfgov-icon symbol="chevron-down" role="img" aria-label="arrow pointing down"></sfgov-icon> | ||
{% endif %} | ||
</div> | ||
</a> | ||
{% if deep %} | ||
{% if url === '/' %} | ||
{% set parent_active = page.url === url %} | ||
{% else %} | ||
{% set parent_active = page.url.startsWith(url) %} | ||
{% endif %} | ||
{% if parent_active %} | ||
<ul class="m-0 p-0 list-none"> | ||
{% for child in children %} | ||
{% set child_active = child.url === page.url %} | ||
<li class="pl-16 m-0 mb-20 {{ 'bg-slate-2 rounded-4' if child_active }}"> | ||
<a | ||
href="{{ child.url }}" | ||
{% if child_active %} | ||
aria-current="page" | ||
{% endif %} | ||
class="block no-underline {{ 'text-white' if child_active else 'text-slate-4' }}" | ||
> | ||
{{ child.data.title }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endif %} | ||
</div> | ||
{% endmacro %} | ||
{{ nav_link('/', false) }} | ||
{{ nav_link('/foundations') }} | ||
{{ nav_link('/components') }} | ||
{{ nav_link('/resources') }} | ||
{{ nav_link('/usage') }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters