Skip to content

Commit 23ea224

Browse files
shawnbotJackson Flint-Gonzales
and
Jackson Flint-Gonzales
authored
Release 2.2.1 (#60)
* 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]>
1 parent f80e010 commit 23ea224

File tree

5 files changed

+58
-57
lines changed

5 files changed

+58
-57
lines changed

docs/_includes/base.njk

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
layout: skeleton
33
---
44

5-
{% from 'nav.njk' import nav_link with context %}
6-
{% set nav %}
7-
{{ nav_link('/', false) }}
8-
{{ nav_link('/foundations') }}
9-
{{ nav_link('/components') }}
10-
{{ nav_link('/usage') }}
11-
{% endset %}
5+
{% from 'macros.njk' import nav_link with context %}
6+
{% set nav %}{% include 'nav.njk' %}{% endset %}
127

138
{% set toc = content | toc %}
149

@@ -23,12 +18,12 @@ layout: skeleton
2318
<div class="z-50 pointer-events-none responsive-container fixed h-full top-0 left-0 right-0 opacity-10">
2419
<div class="responsive-grid grid md:hidden h-full">
2520
{% for i in range(0, 6) %}
26-
<div style="background-color: '#FF0000'"></div>
21+
<div style="background-color: #FF0000"></div>
2722
{% endfor %}
2823
</div>
2924
<div class="responsive-grid hidden md:grid h-full">
3025
{% for i in range(0, 12) %}
31-
<div style="background-color: '#FF0000'"></div>
26+
<div style="background-color: #FF0000"></div>
3227
{% endfor %}
3328
</div>
3429
</div>

docs/_includes/macros.njk

+46
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
{% macro nav_link(url, deep=true) %}
2+
{% set node = url | node(collections.all) %}
3+
{% set children = node.data.page | children(collections.all) %}
4+
<div class="mb-20">
5+
<a
6+
class="flex justify-center title-xs no-underline mb-20"
7+
href="{{ url }}"
8+
{% if node.data.page.url === page.url %}
9+
aria-current="page"
10+
{% endif %}
11+
>
12+
<div class="flex-auto">{{ node.data.title }}</div>
13+
<div>
14+
{% if deep and children.length %}
15+
<sfgov-icon symbol="chevron-down" role="img" aria-label="arrow pointing down"></sfgov-icon>
16+
{% endif %}
17+
</div>
18+
</a>
19+
{% if deep %}
20+
{% if url === '/' %}
21+
{% set parent_active = page.url === url %}
22+
{% else %}
23+
{% set parent_active = page.url.startsWith(url) %}
24+
{% endif %}
25+
{% if parent_active %}
26+
<ul class="m-0 p-0 list-none">
27+
{% for child in children %}
28+
{% set child_active = child.url === page.url %}
29+
<li class="pl-16 m-0 mb-20 {{ 'bg-slate-2 rounded-4' if child_active }}">
30+
<a
31+
href="{{ child.url }}"
32+
{% if child_active %}
33+
aria-current="page"
34+
{% endif %}
35+
class="block no-underline {{ 'text-white' if child_active else 'text-slate-4' }}"
36+
>
37+
{{ child.data.title }}
38+
</a>
39+
</li>
40+
{% endfor %}
41+
</ul>
42+
{% endif %}
43+
{% endif %}
44+
</div>
45+
{% endmacro %}
46+
147
{% macro swatch(color, width, height) %}
248
<div class="mr-20 mb-20">
349
<h4 class="title-xs mt-0 mb-4">

docs/_includes/nav.njk

+5-45
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,5 @@
1-
{% macro nav_link(url, deep=true) %}
2-
{% set node = url | node(collections.all) %}
3-
{% set children = node.data.page | children(collections.all) %}
4-
<div class="mb-20">
5-
<a
6-
class="flex justify-center title-xs no-underline mb-20"
7-
href="{{ url }}"
8-
{% if node.data.page.url === page.url %}
9-
aria-current="page"
10-
{% endif %}
11-
>
12-
<div class="flex-auto">{{ node.data.title }}</div>
13-
<div>
14-
{% if deep and children.length %}
15-
<sfgov-icon symbol="chevron-down" role="img" aria-label="arrow pointing down"></sfgov-icon>
16-
{% endif %}
17-
</div>
18-
</a>
19-
{% if deep %}
20-
{% if url === '/' %}
21-
{% set parent_active = page.url === url %}
22-
{% else %}
23-
{% set parent_active = page.url.startsWith(url) %}
24-
{% endif %}
25-
{% if parent_active %}
26-
<ul class="m-0 p-0 list-none">
27-
{% for child in children %}
28-
{% set child_active = child.url === page.url %}
29-
<li class="pl-16 m-0 mb-20 {{ 'bg-slate-2 rounded-4' if child_active }}">
30-
<a
31-
href="{{ child.url }}"
32-
{% if child_active %}
33-
aria-current="page"
34-
{% endif %}
35-
class="block no-underline {{ 'text-white' if child_active else 'text-slate-4' }}"
36-
>
37-
{{ child.data.title }}
38-
</a>
39-
</li>
40-
{% endfor %}
41-
</ul>
42-
{% endif %}
43-
{% endif %}
44-
</div>
45-
{% endmacro %}
1+
{{ nav_link('/', false) }}
2+
{{ nav_link('/foundations') }}
3+
{{ nav_link('/components') }}
4+
{{ nav_link('/resources') }}
5+
{{ nav_link('/usage') }}

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sfgov-design-system",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"repository": "SFDigitalServices/design-system",
55
"author": "City & County of San Francisco, California",
66
"license": "MIT",

0 commit comments

Comments
 (0)