Skip to content

Commit d97c74d

Browse files
committed
refactored nav data to be more customizable, added docs to resources
1 parent 021e744 commit d97c74d

10 files changed

+84
-51
lines changed

content/for-individuals.de.html

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
---
22
title: "Cryptomator"
33
type: for-individuals
4-
5-
navbadge: "Für Einzelnutzer"
64
---

content/for-individuals.en.html

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
---
22
title: "Cryptomator"
33
type: for-individuals
4-
5-
navbadge: "For Individuals"
64
---

content/for-teams.de.html

-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
title: "Cryptomator Hub"
33
type: for-teams
44
aliases: ["/de/hub"]
5-
6-
navbadge: "Für Teams"
75
---

content/for-teams.en.html

-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
title: "Cryptomator Hub"
33
type: for-teams
44
aliases: ["/hub"]
5-
6-
navbadge: "For Teams"
75
---

content/pricing.de.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
2-
title: "Preise und Funktionen"
2+
title: "Preise"
33
url: "/de/pricing"
44
type: "pricing"
55
description: "Schütze deine Daten mit unseren Open-Source-Lösungen zu fairen Preisen. Ob für den privaten Gebrauch mit Cryptomator oder für die Teamarbeit mit Cryptomator Hub — unsere Optionen passen zu deinen Bedürfnissen, ohne versteckte Kosten."
6-
7-
navtitle: "Preise"
86
---

content/pricing.en.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
2-
title: "Pricing and Features"
2+
title: "Pricing"
33
url: "/pricing"
44
type: "pricing"
55
description: "Secure your data with our open-source solutions at fair prices. Whether for personal use with Cryptomator or team collaboration with Cryptomator Hub, our plans are designed to fit your needs — no hidden costs, just transparent protection."
6-
7-
navtitle: "Pricing"
86
---

data/nav.yaml

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
- Title: nav_products
2-
Children: ["/for-individuals", "/for-teams", "|", "/downloads"]
3-
- URL: "/pricing"
2+
Dropdown:
3+
- Path: "/for-individuals"
4+
Badge: nav_products_for_individuals_badge
5+
- Path: "/for-teams"
6+
Badge: nav_products_for_teams_badge
7+
- Separator: true
8+
- Path: "/downloads"
9+
- Path: "/pricing"
410
- Title: nav_support_us
5-
Children: ["/supporter-cert", "/donate", "/sponsors"]
11+
Dropdown:
12+
- Path: "/supporter-cert"
13+
- Path: "/donate"
14+
- Path: "/sponsors"
615
- Title: nav_resources
7-
Children: ["/blog", "/guides", "/compliance", "/comparisons", "|", "/coop", "/enterprise"]
16+
Dropdown:
17+
- Path: "/blog"
18+
- Path: "/guides"
19+
- Path: "/comparisons"
20+
- Path: "/compliance"
21+
- Separator: true
22+
- Path: "/coop"
23+
- Path: "/enterprise"
24+
- Separator: true
25+
- Title: nav_docs
26+
URL: "https://docs.cryptomator.org/"
27+
UmamiEvent: "docs"

i18n/de.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
translation: "Jetzt loslegen"
55
- id: nav_products
66
translation: "Produkte"
7-
- id: nav_resources
8-
translation: "Ressourcen"
7+
- id: nav_products_for_individuals_badge
8+
translation: "Für Einzelnutzer"
9+
- id: nav_products_for_teams_badge
10+
translation: "Für Teams"
911
- id: nav_support_us
1012
translation: "Unterstütze uns"
13+
- id: nav_resources
14+
translation: "Ressourcen"
15+
- id: nav_docs
16+
translation: "Docs"
1117
- id: nav_github
1218
translation: "Cryptomator auf GitHub"
1319
- id: footer_contribute_title

i18n/en.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
translation: "Get Started"
55
- id: nav_products
66
translation: "Products"
7-
- id: nav_resources
8-
translation: "Resources"
7+
- id: nav_products_for_individuals_badge
8+
translation: "For Individuals"
9+
- id: nav_products_for_teams_badge
10+
translation: "For Teams"
911
- id: nav_support_us
1012
translation: "Support Us"
13+
- id: nav_resources
14+
translation: "Resources"
15+
- id: nav_docs
16+
translation: "Docs"
1117
- id: nav_github
1218
translation: "Cryptomator on GitHub"
1319
- id: footer_contribute_title

layouts/partials/nav.html

+42-29
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<ul class="hidden lg:flex items-stretch list-none m-0">
2222
{{- range .Site.Data.nav }}
23-
{{- if .Title }}
23+
{{- if .Dropdown }}
2424
<!-- Dropdown item -->
2525
<li x-data="{ isDropdownOpen: false, openedByHover: false }" class="flex items-center mx-2 border-b-2 border-transparent" @mouseenter="isDropdownOpen = true; openedByHover = true" @mouseleave="isDropdownOpen = false; openedByHover = false" @click.outside="isDropdownOpen = false">
2626
<button @click="if (!openedByHover) { isDropdownOpen = !isDropdownOpen }" class="whitespace-nowrap p-2">
@@ -29,34 +29,41 @@
2929
</button>
3030
<div class="absolute">
3131
<ul x-show="isDropdownOpen" x-cloak class="absolute mt-6 py-2 whitespace-nowrap bg-white rounded-sm shadow-md z-50">
32-
{{- range .Children }}
33-
{{- if eq . "|" }}
34-
<li>
35-
<hr class="border-gray-200 my-2"/>
36-
</li>
37-
{{- else }}
38-
{{- with $.Site.GetPage . }}
32+
{{- range $dropdownItem := .Dropdown }}
33+
{{- if $dropdownItem.Path }}
34+
{{- with $.Site.GetPage $dropdownItem.Path }}
3935
<li>
4036
<a href="{{ .RelPermalink }}" class="flex items-center px-4 py-2 text-gray-800 hover:bg-secondary hover:text-white hover:no-underline" data-umami-event="nav-{{ replaceRE "^.*/([^/]+)/?$" "$1" .RelPermalink }}">
41-
<span>{{ cond (isset .Params "navtitle") .Params.Navtitle .Title }}</span>
42-
{{- if .Params.Navbadge }}
43-
<span class="inline-flex px-2 py-1 rounded-full text-xs font-medium tracking-wide uppercase bg-primary-l2 text-dark ml-2">{{ .Params.Navbadge }}</span>
37+
<span>{{ .Title }}</span>
38+
{{- if $dropdownItem.Badge }}
39+
<span class="inline-flex px-2 py-1 rounded-full text-xs font-medium tracking-wide uppercase bg-primary-l2 text-dark ml-2">{{ i18n $dropdownItem.Badge . }}</span>
4440
{{- end }}
4541
</a>
4642
</li>
4743
{{- end }}
44+
{{- else if $dropdownItem.URL }}
45+
<li>
46+
<a href="{{ $dropdownItem.URL }}" target="_blank" rel="noopener" class="flex items-center px-4 py-2 text-gray-800 hover:bg-secondary hover:text-white hover:no-underline" data-umami-event="nav-{{ $dropdownItem.UmamiEvent }}">
47+
<span>{{ i18n $dropdownItem.Title . }}</span>
48+
<i class="fas fa-external-link fa-fw ml-2"></i>
49+
</a>
50+
</li>
51+
{{- else if $dropdownItem.Separator }}
52+
<li>
53+
<hr class="border-gray-200 my-2"/>
54+
</li>
4855
{{- end }}
4956
{{- end }}
5057
</ul>
5158
</div>
5259
</li>
53-
{{- else if .URL }}
54-
<!-- Direct link -->
55-
{{- with $.Site.GetPage .URL }}
60+
{{- else if .Path }}
61+
<!-- Page item -->
62+
{{- with $.Site.GetPage .Path }}
5663
{{- $navItemBorderColor := cond (hasPrefix $currentRelPermalink .RelPermalink) $borderColor "border-transparent" }}
5764
<li class="flex items-center mx-2 border-b-2 {{ $navItemBorderColor }} {{ $hoverBorderColor }}">
5865
<a class="p-2 hover:no-underline" href="{{ .RelPermalink }}" data-umami-event="nav-{{ replaceRE "^.*/([^/]+)/?$" "$1" .RelPermalink }}">
59-
{{ cond (isset .Params "navtitle") .Params.Navtitle .Title }}
66+
{{ .Title }}
6067
</a>
6168
</li>
6269
{{- end }}
@@ -107,31 +114,37 @@
107114
<!-- Smartphone Navigation -->
108115
<div :class="isNavOpen ? 'block' : 'hidden'" x-cloak class="lg:hidden max-h-[calc(100vh-48px)] overflow-y-auto">
109116
{{- range .Site.Data.nav }}
110-
{{- if .Title }}
117+
{{- if .Dropdown }}
111118
<div class="uppercase tracking-wide text-gray-500 text-xs font-bold p-2">
112119
{{ i18n .Title . }}
113120
</div>
114-
{{- range .Children }}
115-
{{- if eq . "|" }}
116-
<hr class="border-primary my-2"/>
117-
{{- else }}
118-
{{- with $.Site.GetPage . }}
119-
<a class="block py-2 mx-2 hover:text-secondary hover:no-underline"
120-
href="{{ .RelPermalink }}" data-umami-event="nav-{{ replaceRE "^.*/([^/]+)/?$" "$1" .RelPermalink }}">
121-
<span>{{ cond (isset .Params "navtitle") .Params.Navtitle .Title }}</span>
122-
{{- if .Params.Navbadge }}
123-
<span class="inline-flex px-2 py-1 rounded-full text-xs font-medium tracking-wide uppercase bg-primary-l2 text-dark ml-2">{{ .Params.Navbadge }}</span>
121+
{{- range $dropdownItem := .Dropdown }}
122+
<!-- Dropdown item -->
123+
{{- if $dropdownItem.Path }}
124+
{{- with $.Site.GetPage $dropdownItem.Path }}
125+
<a class="flex items-center py-2 mx-2 hover:text-secondary hover:no-underline" href="{{ .RelPermalink }}" data-umami-event="nav-{{ replaceRE "^.*/([^/]+)/?$" "$1" .RelPermalink }}">
126+
<span>{{ .Title }}</span>
127+
{{- if $dropdownItem.Badge }}
128+
<span class="inline-flex px-2 py-1 rounded-full text-xs font-medium tracking-wide uppercase bg-primary-l2 text-dark ml-2">{{ i18n $dropdownItem.Badge . }}</span>
124129
{{- end }}
125130
</a>
126131
{{- end }}
132+
{{- else if $dropdownItem.URL }}
133+
<a class="flex items-center py-2 mx-2 hover:text-secondary hover:no-underline" href="{{ $dropdownItem.URL }}" target="_blank" rel="noopener" data-umami-event="nav-{{ $dropdownItem.UmamiEvent }}">
134+
<span>{{ i18n $dropdownItem.Title . }}</span>
135+
<i class="fas fa-external-link fa-fw ml-2"></i>
136+
</a>
137+
{{- else if $dropdownItem.Separator }}
138+
<hr class="border-primary my-2"/>
127139
{{- end }}
128140
{{- end }}
129141
<hr class="border-primary my-2"/>
130-
{{- else if .URL }}
131-
{{- with $.Site.GetPage .URL }}
142+
{{- else if .Path }}
143+
<!-- Page item -->
144+
{{- with $.Site.GetPage .Path }}
132145
<a class="block py-2 mx-2 hover:text-secondary hover:no-underline"
133146
href="{{ .RelPermalink }}" data-umami-event="nav-{{ replaceRE "^.*/([^/]+)/?$" "$1" .RelPermalink }}">
134-
{{ cond (isset .Params "navtitle") .Params.Navtitle .Title }}
147+
{{ .Title }}
135148
</a>
136149
<hr class="border-primary my-2"/>
137150
{{- end }}

0 commit comments

Comments
 (0)