Skip to content

Commit 40a246d

Browse files
committed
Added category list for examples
1 parent 2a546f0 commit 40a246d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

examples/index.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,34 @@ <h1>Learn from examples!</h1>
1717

1818
{% include learnnav.html showmenu=true %}
1919

20+
{% assign all_categories = site.data.examplesindex | map: "category" | uniq | sort %}
21+
2022
<div class="section lightest dark:dark">
2123
<div class="container">
22-
{% assign all_categories = site.data.examplesindex | map: "category" | uniq | sort %}
24+
<div class="row">
25+
<div class="columns full">
26+
<h2 id="categories">Categories</h2>
27+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); grid-gap: 0 1rem; font-size: 0.9em;">
28+
{% for category in all_categories %}
29+
<a href="#{{ category }}">{{ category | capitalize }}</a>
30+
{% endfor %}
31+
</div>
32+
<br/>
33+
</div>
34+
</div>
2335
{% for category in all_categories %}
2436
<div class="row">
2537
<div class="columns full">
26-
<h3>{{ category | capitalize }}</h3>
38+
<h3 id="{{ category }}">{{ category | capitalize }}</h3>
2739
<div class="grid-250">
2840
{%- assign examples = site.data.examplesindex | where: "category", category -%}
2941
{%- for example in examples -%}
3042
{% include learn_card.html title=example.title description=example.brief link=example.path min-height="250px" %}
3143
{%- endfor -%}
3244
</div>
45+
<p>˄ <a href="#categories">Top</a></p>
3346
</div>
34-
<br/>
3547
</div>
3648
{% endfor %}
49+
</div>
3750
</div>

0 commit comments

Comments
 (0)