Skip to content

Commit 485b428

Browse files
authored
feat: update docs landing page (#76)
* feat: removed "Explore all products" and added new link dropdown instead * fix bug with closing dropdown * updated nginx description in dropdown * added new description for nginx.org
1 parent 7920065 commit 485b428

File tree

4 files changed

+91
-3
lines changed

4 files changed

+91
-3
lines changed

assets/css/f5-hugo.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,4 +1606,43 @@ li.nav-item a.nav-link {
16061606
.f5-logo-footer {
16071607
height: 32px;
16081608
width: 32px;
1609+
}
1610+
1611+
.link-chevron-icon {
1612+
transition: transform 0.15s ease-in-out;
1613+
}
1614+
1615+
.rotate-chevron {
1616+
transform: rotate(180deg);
1617+
}
1618+
1619+
.dropdown-content {
1620+
position: absolute;
1621+
background-color: white;
1622+
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1623+
z-index: 1;
1624+
right: 0;
1625+
display: none;
1626+
width: 400px;
1627+
max-width: 80vw;
1628+
margin-right: 8px;
1629+
}
1630+
1631+
.dropdown-content ul {
1632+
padding: 20px 10px;
1633+
list-style: none;
1634+
}
1635+
1636+
@media (max-width: 767px) {
1637+
.dropdown-content {
1638+
right: auto;
1639+
left: 50%;
1640+
transform: translateX(-50%);
1641+
margin-right: 0px;
1642+
}
1643+
}
1644+
1645+
.remove-bottom-radius {
1646+
border-bottom-left-radius: 0;
1647+
border-bottom-right-radius: 0;
16091648
}

assets/js/product-dropdown.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
$(document).ready(function () {
2+
const dropdownContent = document.getElementById("dropdown-content");
3+
const navbarButton = document.getElementById("navbar-sites-button");
4+
const chevronIcon = document.getElementById("navbar-sites-button-icon");
5+
6+
$("#navbar-sites-button").on("click", () => {
7+
chevronIcon.classList.toggle('rotate-chevron');
8+
9+
if (dropdownContent.style.display === "block") {
10+
dropdownContent.style.display = "none";
11+
navbarButton.classList.remove("remove-bottom-radius");
12+
} else {
13+
dropdownContent.style.display = "block";
14+
navbarButton.classList.add("remove-bottom-radius");
15+
}
16+
});
17+
18+
window.onclick = function(event) {
19+
if (!event.target.matches('#navbar-sites-button') && !event.target.matches('#navbar-sites-button-icon')) {
20+
if(dropdownContent.style.display !== "none" && dropdownContent.style.display !== ""){
21+
chevronIcon.classList.toggle('rotate-chevron');
22+
}
23+
dropdownContent.style.display = "none"
24+
navbarButton.classList.remove("remove-bottom-radius");
25+
}
26+
}
27+
})

layouts/partials/header.html

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,28 @@
2525
</ul>
2626
</div>
2727
{{ end }}
28-
28+
29+
{{ $f5Sites := slice
30+
(dict "title" "DevCentral" "url" "https://community.f5.com/" "description" "Connect & learn in our hosted community")
31+
(dict "title" "MyF5" "url" "https://my.f5.com/" "description" "Your key to everything F5, including support, registration keys, and subscriptions")
32+
(dict "title" "NGINX" "url" "https://nginx.org/" "description" "Learn more about NGINX Open Source and read the community blog")
33+
}}
2934
<ul class="navbar navbar-nav">
3035
<li class="nav-item-explore active">
31-
<button class="button navbar-button"><a href="https://www.f5.com/products" alt="Explore all products on f5.com" target="_blank">Explore All Products</a></button>
36+
<button id="navbar-sites-button" class="button navbar-button" style="display: flex; gap: 8px; align-items: center;">
37+
F5 Sites
38+
<i id="navbar-sites-button-icon" class="link-chevron-icon fa-solid fa-chevron-down"></i>
39+
</button>
40+
<div class="dropdown-content" id="dropdown-content">
41+
<ul>
42+
{{ range $f5Sites }}
43+
<li>
44+
<a href="{{ .url }}">{{ .title }}</a>
45+
<p>{{ .description }}</p>
46+
</li>
47+
{{ end }}
48+
</ul>
49+
</div>
3250
</li>
3351
</ul>
3452
</div>

layouts/partials/scripts.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,8 @@
5959
<!-- Inline theme switcher -->
6060
{{ $jsThemeSwitcher := resources.Get "js/theme-switcher.js" | minify | fingerprint "sha512" }}
6161
<script src="{{ $jsThemeSwitcher.RelPermalink }}" type="text/javascript"
62-
integrity="{{ $jsThemeSwitcher.Data.Integrity }}"></script>
62+
integrity="{{ $jsThemeSwitcher.Data.Integrity }}"></script>
63+
64+
<!-- Load Product Dropdown javascript -->
65+
{{ $jsProductDropdown := resources.Get "js/product-dropdown.js" | minify | fingerprint "sha512" }}
66+
<script src="{{ $jsProductDropdown.RelPermalink }}" type="text/javascript" integrity="{{ $jsProductDropdown.Data.Integrity }}"></script>

0 commit comments

Comments
 (0)