Skip to content

Commit 19e2191

Browse files
authored
F5Sites: Move to partial and links to yaml (#384)
1 parent 8562a8e commit 19e2191

File tree

3 files changed

+33
-28
lines changed

3 files changed

+33
-28
lines changed

exampleSite/data/f5-sites.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- title: NGINX Documentation
2+
url: https://docs.nginx.com/
3+
description: Learn how to deliver, manage, and protect your applications using F5 NGINX products.
4+
5+
- title: NGINX
6+
url: https://nginx.org/
7+
description: Learn more about NGINX Open Source and read the community blog

layouts/partials/f5-sites.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<div class="header__f5sites">
2+
{{ with index .Site.Data "f5-sites" }}
3+
{{ $f5Sites := . }}
4+
<div class="navbar navbar-nav">
5+
<div class="nav-item-explore active">
6+
<button id="navbar-sites-button" class="button navbar-button dropdown-button" data-testid="header__f5sites_button">
7+
F5 Sites
8+
<span class="header__f5sites--icon">
9+
{{ partial "lucide" (dict "context" . "icon" "chevron-down") }}
10+
</span>
11+
</button>
12+
<div class="dropdown-content" id="dropdown-content" data-testid="header__f5sites_content">
13+
<ul>
14+
{{ range $f5Sites }}
15+
<li>
16+
<a href="{{ .url }}" target="_blank" >{{ .title }}</a>
17+
<p>{{ .description }}</p>
18+
</li>
19+
{{ end }}
20+
</ul>
21+
</div>
22+
</div>
23+
</div>
24+
{{ end }}
25+
</div>

layouts/partials/header.html

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,8 @@
2828
</a>
2929
</div>
3030

31-
<div class="header__f5sites">
32-
{{ $f5Sites := slice
33-
(dict "title" "DevCentral" "url" "https://community.f5.com/" "description" "Connect & learn in our hosted community")
34-
(dict "title" "MyF5" "url" "https://my.f5.com/" "description" "Your key to everything F5, including support, registration keys, and subscriptions")
35-
(dict "title" "NGINX" "url" "https://nginx.org/" "description" "Learn more about NGINX Open Source and read the community blog")
36-
}}
31+
{{ partial "f5-sites.html" . }}
3732

38-
<div class="navbar navbar-nav">
39-
<div class="nav-item-explore active">
40-
<button id="navbar-sites-button" class="button navbar-button dropdown-button" data-testid="header__f5sites_button">
41-
F5 Sites
42-
<span class="header__f5sites--icon">
43-
{{ partial "lucide" (dict "context" . "icon" "chevron-down") }}
44-
</span>
45-
</button>
46-
<div class="dropdown-content" id="dropdown-content" data-testid="header__f5sites_content">
47-
<ul>
48-
{{ range $f5Sites }}
49-
<li>
50-
<a href="{{ .url }}" target="_blank" >{{ .title }}</a>
51-
<p>{{ .description }}</p>
52-
</li>
53-
{{ end }}
54-
</ul>
55-
</div>
56-
</div>
57-
</div>
58-
59-
</div>
6033
</div>
6134
<div class="header-search-dropdown">
6235
<atomic-external selector="#search-standalone-header">

0 commit comments

Comments
 (0)