Skip to content

Commit 4af36fc

Browse files
committed
Define the navigation panel using the config file
1 parent 2550894 commit 4af36fc

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

data/navigation.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Shows the categories order for the navigation bar
2+
tags:
3+
- featured
4+
- all
5+
- wiremock
6+
- analytics
7+
- backend
8+
- cloud
9+
- collaboration
10+
- customer_relation
11+
- developer_tools
12+
- ecommerce
13+
- education
14+
- email
15+
- enterprise
16+
- entertainment
17+
- financial
18+
- forms
19+
- hosting
20+
- iot
21+
- location
22+
- machine_learning
23+
- marketing
24+
- media
25+
- messaging
26+
- monitoring
27+
- open_data
28+
- payment
29+
- search
30+
- security
31+
- social
32+
- storage
33+
- support
34+
- telecom
35+
- text
36+
- tools
37+
- transport

layouts/partials/nav-tags.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,25 @@
2929
x-transition:leave-end="opacity-0 translate-y-1"
3030
@click.outside="dropdown = false"
3131
class="absolute z-10 top-12 min-w-[16rem] bg-white rounded-md shadow-xl hidden py-2.5">
32-
{{ range site.Taxonomies.tags }}
32+
{{ range $.Site.Data.navigation.tags }}
33+
{{ $tagId := . }}
34+
{{ range $taxonomyname, $taxonomy := $.Site.Taxonomies.tags }}
35+
{{ if eq $taxonomyname $tagId }}
3336
<a class="{{ if eq .Page.Permalink $.Permalink }}text-sky-600{{ else }}text-slate-500{{ end }} hover:text-sky-600 block px-5 py-2" href="{{ .Page.Permalink }}">{{ strings.FirstUpper (replace .Page.Title "_" " ") }}</a>
37+
{{ end }}
3438
{{ end }}
39+
{{ end }}
3540
</div>
3641
</div>
3742
<div class="hidden lg:flex -mt-2">
3843
<div class="flex flex-col">
39-
{{ range site.Taxonomies.tags }}
40-
<a class="{{ if eq .Page.Permalink $.Permalink }}text-sky-600 underline underline-offset-4 decoration-sky-600{{ else }}text-slate-500{{ end }} py-1.5 text-lg hover:text-sky-600 whitespace-nowrap" href="{{ .Page.Permalink }}">{{ strings.FirstUpper (replace .Page.Title "_" " ") }}</a>
44+
{{ range $.Site.Data.navigation.tags }}
45+
{{ $tagId := . }}
46+
{{ range $taxonomyname, $taxonomy := $.Site.Taxonomies.tags }}
47+
{{ if eq $taxonomyname $tagId }}
48+
<a class="{{ if eq .Page.Permalink $.Permalink }}text-sky-600 underline underline-offset-4 decoration-sky-600{{ else }}text-slate-500{{ end }} py-1.5 text-lg hover:text-sky-600 whitespace-nowrap" href="{{ .Page.Permalink }}">{{ strings.FirstUpper (replace .Page.Title "_" " ") }}</a>
49+
{{ end }}
50+
{{ end }}
4151
{{ end }}
4252
</div>
4353
</div>

0 commit comments

Comments
 (0)