Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 78 additions & 7 deletions assets/css/v2/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ ol li:last-child {
.grid-container {
display: grid;
grid-template-columns: var(--sidebar-width) 1fr;
grid-template-rows: var(--header-height) 1fr auto;
grid-template-rows: auto 1fr auto;
grid-template-areas:
"sidebar header"
"sidebar content"
Expand Down Expand Up @@ -504,23 +504,71 @@ ol li:last-child {
.header {
grid-area: header;
display: flex;
padding: 0 var(--space-s);
border-bottom: 1px solid oklch(var(--color-divider));
background: oklch(var(--color-background));
position: sticky;
top: 0;
z-index: 2;

.header-base {
width: 100%;
position: relative;
}

.header-search-dropdown {
position: absolute;
width: 100%;
background: white;
border-top: 1px solid oklch(var(--color-divider));
border-bottom: 1px solid oklch(var(--color-divider));
padding: var(--space-m) var(--space-s);
align-items: center;
display: none;

atomic-external {
width: 100%;
}

atomic-search-box {
width: 100%;

&::part(wrapper) {
border-color: oklch(var(--color-codeblock-border));
}

&::part(submit-button-wrapper) {
display: none;
}

&::part(textarea) {
font-size: var(--atomic-text-base);
padding: var(--space-s) var(--space-s);
font-weight: 400;
}

&::part(suggestions-wrapper) {
border-color: oklch(var(--color-codeblock-border));
}
}
}

.header-dropdown-mobile {
position: absolute;
bottom: 0;
width: 100%;
height: 8rem;
}

.header-container {
display: flex;
flex-direction: row;
padding: 0 var(--space-s);
justify-content: space-between;
flex-wrap: wrap;
column-gap: 2rem;
align-items: center;
width: 100%;
height: 64px;
position: relative;

/* This is fine unless we actually want it to break document flow at super tiny viewports */
.header__logo {
Expand All @@ -533,6 +581,11 @@ ol li:last-child {
height: 2.5rem;
}

.header__search--mobile--search--button {
cursor: pointer;
display: none;
}

.header__search {
display: block;
width: auto;
Expand Down Expand Up @@ -595,7 +648,7 @@ ol li:last-child {
background-color: oklch(var(--color-background));
border: oklch(var(--color-foreground)) 1px solid;
box-shadow: 3px 3px 0px oklch(var(--color-shadow));
z-index: 1;
z-index: 20;
right: 0;
display: none;
width: 400px;
Expand Down Expand Up @@ -811,6 +864,13 @@ ol li:last-child {

/* This is our "mobile" or no sidebar breakpoint */
@media (max-width: 68rem) {
#search-standalone-header-panel:checked ~ .grid-container {
.header {
.header-search-dropdown {
display: flex;
}
}
}
#sidebar-panel:not(:checked) ~ .grid-container {
.header {
.header__control--sidebar--close {
Expand Down Expand Up @@ -883,6 +943,14 @@ ol li:last-child {
}
}

.grid-container:has(.no-sidebar) {
.header {
.header__search--mobile--search--button {
display: block;
}
}
}

.header {
.product-selector {
display: none;
Expand All @@ -900,7 +968,9 @@ ol li:last-child {
}
.header-container {
.header__search {
display: none;
#search-standalone-header {
display: none;
}
}
}
}
Expand Down Expand Up @@ -1336,6 +1406,7 @@ atomic-search-box::part(textarea-expander) {
atomic-search-box::part(textarea) {
padding-left: 0;
padding-right: 0;
font-weight: 400;
}

atomic-search-box::part(wrapper) {
Expand All @@ -1359,8 +1430,8 @@ atomic-search-interface#search-standalone-header {

.header-search-box {
&::part(wrapper) {
border-color: oklch(var(--color-codeblock-border));
border-radius: 0;
border-color: oklch(var(--color-foreground));
}

&::part(textarea) {
Expand All @@ -1370,7 +1441,7 @@ atomic-search-interface#search-standalone-header {

&::part(suggestions-wrapper) {
border-radius: 0;
border-color: oklch(var(--color-foreground));
border-color: oklch(var(--color-codeblock-border));
width: calc(100% + 2px);
margin-inline-start: -1px;
}
Expand Down
3 changes: 2 additions & 1 deletion exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ maxAge = -1
[params]
github_repo = "https://github.com/nginxinc/nginx-hugo-theme"
github_subdir = "exampleSite"
enable_last_modified = true
enable_last_modified = true
coveo_search_redirect = "/search.html"
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "main"}}

<div class="content">
<div class="content no-sidebar">
<div class="not-found-container">
<h1 class="info-header">
HTTP 404 - Page not found
Expand Down
1 change: 1 addition & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
{{ if or ( not hugo.IsServer ) ( not ( in .Site.Params.buildtype "package" ) ) }}
{{ partial "universal-tag.html" . }}
{{ end }}
<input type="checkbox" id="search-standalone-header-panel" class="search-standalone-header-panel" hidden/>
<input type="checkbox" id="sidebar-panel" class="sidebar-panel" hidden/>
<div class="grid-container">
<aside class="sidebar">
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/coveo-atomic-search.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $redirectionUrl := .redirectionUrl | default "/search.html" }}
{{ $redirectionUrl := .redirectionUrl | default .Site.Params.coveo_search_redirect | default "/search.html" }}
{{ $id := .id | default "search-standalone-header"}}
<atomic-search-interface id={{ $id }}>
<atomic-search-box redirection-url={{ $redirectionUrl }} class="header-search-box">
Expand Down
108 changes: 60 additions & 48 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,68 @@
{{ define "header" }}
<div class="header-container">
<div class="header__control">
<div class="header__control--sidebar">
<label class="header__control--sidebar--close" for="sidebar-panel">
{{ partial "lucide" (dict "context" . "icon" "panel-left-close") }}
</label>
<label class="header__control--sidebar--open" for="sidebar-panel">
{{ partial "lucide" (dict "context" . "icon" "panel-left-open") }}
</label>
</div>
{{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
<div class="header__search">
<!-- Standalone search box. -->
{{ partial "coveo-atomic-search.html" (dict "id" "search-standalone-header") }}
</div>
{{ end }}
</div>
<div class="header-base">
<div class="header-container">
<div class="header__control">
<div class="header__control--sidebar">
<label class="header__control--sidebar--close" for="sidebar-panel">
{{ partial "lucide" (dict "context" . "icon" "panel-left-close") }}
</label>
<label class="header__control--sidebar--open" for="sidebar-panel">
{{ partial "lucide" (dict "context" . "icon" "panel-left-open") }}
</label>
</div>
{{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
<!-- Mobile button -->
<label class="header__search--mobile--search--button"for="search-standalone-header-panel">
{{ partial "lucide" (dict "context" . "icon" "search") }}
</label>
<div class="header__search">
<!-- Standalone search box. -->
{{ partial "coveo-atomic-search.html" (dict "id" "search-standalone-header") }}
</div>
{{ end }}
</div>

<div class="header__logo">
<a class="header__logo-link" href="{{ .Site.BaseURL | relLangURL }}" alt="NGINX Docs Home">
<img class="header__img" src="{{ "/images/icons/NGINX-Open-Source-product-icon.svg" | absURL }}" alt="NGINX Docs">
</a>
</div>
<div class="header__logo">
<a class="header__logo-link" href="{{ .Site.BaseURL | relLangURL }}" alt="NGINX Docs Home">
<img class="header__img" src="{{ "/images/icons/NGINX-Open-Source-product-icon.svg" | absURL }}" alt="NGINX Docs">
</a>
</div>

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

<div class="navbar navbar-nav">
<div class="nav-item-explore active">
<button id="navbar-sites-button" class="button navbar-button dropdown-button" data-testid="header__f5sites_button">
F5 Sites
<span class="header__f5sites--icon">
{{ partial "lucide" (dict "context" . "icon" "chevron-down") }}
</span>
</button>
<div class="dropdown-content" id="dropdown-content" data-testid="header__f5sites_content">
<ul>
{{ range $f5Sites }}
<li>
<a href="{{ .url }}" target="_blank" >{{ .title }}</a>
<p>{{ .description }}</p>
</li>
{{ end }}
</ul>
<div class="navbar navbar-nav">
<div class="nav-item-explore active">
<button id="navbar-sites-button" class="button navbar-button dropdown-button" data-testid="header__f5sites_button">
F5 Sites
<span class="header__f5sites--icon">
{{ partial "lucide" (dict "context" . "icon" "chevron-down") }}
</span>
</button>
<div class="dropdown-content" id="dropdown-content" data-testid="header__f5sites_content">
<ul>
{{ range $f5Sites }}
<li>
<a href="{{ .url }}" target="_blank" >{{ .title }}</a>
<p>{{ .description }}</p>
</li>
{{ end }}
</ul>
</div>
</div>
</div>
</div>
</div>

</div>
</div>
</div>
<div class="header-search-dropdown">
<atomic-external selector="#search-standalone-header">
{{ $redirectUrl := default .Site.Params.coveo_search_redirect "/search.html" }}
<atomic-search-box redirection-url={{ $redirectUrl }}></atomic-search-box>
</atomic-external>
</div>
</div>
{{ end }}
4 changes: 2 additions & 2 deletions layouts/partials/homepage.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="homepage">
<div class="homepage no-sidebar">
<div class="homepage-section">
{{ .Content }}
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion layouts/search/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
<section class="search">
<section class="search no-sidebar">
{{ partial "coveo-atomic.html" .}}
</section>
{{ end }}