Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules/
package-lock.json
pagefind
tmp/
_vendor/

# Local Netlify folder
.netlify
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ serve:

production-build:
npx hugo mod clean --all
npx hugo mod get github.com/google/docsy@v0.6.0 github.com/google/docsy/[email protected].0
npx hugo mod get github.com/google/docsy@v0.13.0
npx hugo --minify
npx -y pagefind --site public

preview-build:
npx hugo mod clean --all
npx hugo mod get github.com/google/docsy@v0.6.0 github.com/google/docsy/[email protected].0
npx hugo mod get github.com/google/docsy@v0.13.0
npx hugo --minify \
--baseURL $(DEPLOY_PRIME_URL) \
--buildDrafts \
Expand Down
4 changes: 4 additions & 0 deletions assets/scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
height: 40px;
}
}
// Hide text title since logo SVG already contains the title
.navbar-brand__name {
display: none;
}
}

// Main nav bar.
Expand Down
3 changes: 0 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,3 @@ tag = "tags"
[[module.imports]]
path = "github.com/google/docsy"
disable = false
[[module.imports]]
path = "github.com/google/docsy/dependencies"
disable = false
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ module github.com/cncf/glossary

go 1.22

require github.com/google/docsy v0.13.0

require (
github.com/google/docsy v0.6.0 // indirect
github.com/google/docsy/dependencies v0.6.0 // indirect
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 // indirect
github.com/twbs/bootstrap v5.3.8+incompatible // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.6.0 h1:43bVF18t2JihAamelQjjGzx1vO2ljCilVrBgetCA8oI=
github.com/google/docsy v0.6.0/go.mod h1:VKKLqD8PQ7AglJc98yBorATfW7GrNVsn0kGXVYF6G+M=
github.com/google/docsy/dependencies v0.6.0 h1:BFXDCINbp8ZuUGl/mrHjMfhCg+b1YX+hVLAA5fGW7Pc=
github.com/google/docsy/dependencies v0.6.0/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE=
github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 h1:/iluJkJiyTAdnqrw3Yi9rH2HNHhrrtCmj8VJe7I6o3w=
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.13.0 h1:Y1oy5SmQ0ikJJsvkuefEVZMj0MTXLmVfpXbt7Ytc7rc=
github.com/google/docsy v0.13.0/go.mod h1:1Fj1W1O3esZh7IBQ8XAYtxtg10udBXuGI89+LUQc1AU=
github.com/twbs/bootstrap v5.3.8+incompatible h1:eK1fsXP7R/FWFt+sSNmmvUH9usPocf240nWVw7Dh02o=
github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions layouts/_partials/navbar-lang-selector.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{/* Link directly to documentation etc., if possible. */ -}}
{{ $langPage := cond (gt (len .Translations) 0) . .Site.Home -}}
<div class="td-lang-menu dropdown">
<a class="nav-link dropdown-toggle td-lang-menu__title" href="#" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="td-lang-menu__title-text">{{ $langPage.Language.LanguageName }}</span>
<span class="td-lang-menu__title-code">{{ $langPage.Language.Lang | upper }}</span>
</a>
{{/* Only show translations, not the current language */ -}}
<ul class="dropdown-menu">
{{ range $langPage.Translations -}}
<li>
<a class="dropdown-item" href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a>
</li>
{{ end -}}
</ul>
</div>
72 changes: 72 additions & 0 deletions layouts/_partials/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{{ $cover := and
(.HasShortcode "blocks/cover")
(not .Site.Params.ui.navbar_translucent_over_cover_disable)
-}}
{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}

<nav class="td-navbar js-navbar-scroll
{{- if $cover }} td-navbar-cover {{- end }}">
<div class="td-navbar-container container-fluid flex-column flex-md-row">
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
{{- /**/ -}}
<span class="navbar-brand__logo navbar-logo">
{{- if ne .Site.Params.ui.navbar_logo false -}}
{{ with resources.Get "icons/logo.svg" -}}
{{ ( . | minify).Content | safeHTML -}}
{{ end -}}
{{ end -}}
</span>
{{- /**/ -}}
<span class="navbar-brand__name">
{{- .Site.Title -}}
</span>
{{- /**/ -}}
</a>
<div class="td-navbar-nav-scroll td-navbar-nav-scroll--indicator" id="main_navbar">
<div class="scroll-indicator scroll-left"></div>
<ul class="navbar-nav">
{{ $p := . -}}
{{ range .Site.Menus.main -}}
<li class="nav-item">
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
{{ $href := "" -}}
{{ with .Page -}}
{{ $active = or $active ( $.IsDescendant .) -}}
{{ $href = .RelPermalink -}}
{{ else -}}
{{ $href = .URL | relLangURL -}}
{{ end -}}
{{ $isExternal := ne $baseURL.Host (urls.Parse .URL).Host -}}
<a {{/**/ -}}
class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}}
href="{{ $href }}"
{{- if $isExternal }} target="_blank" rel="noopener" {{- end -}}
>
{{- .Pre -}}
<span>{{ .Name }}</span>
{{- .Post -}}
</a>
</li>
{{ end -}}
{{ if .Site.Params.versions -}}
<li class="nav-item dropdown d-none d-lg-block td-navbar__version-menu">
{{ partial "navbar-version-selector.html" . -}}
</li>
{{ end -}}
{{ if (gt (len .Site.Home.Translations) 0) -}}
<li class="nav-item td-navbar__lang-menu">
{{ partial "navbar-lang-selector.html" . -}}
</li>
{{ end -}}
{{- $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}}
{{ if $darkMode.showMenu -}}
<li class="nav-item td-navbar__light-dark-menu">
{{ partial "theme-toggler" . }}
</li>
{{ end -}}
</ul>
<div class="scroll-indicator scroll-right"></div>
</div>
{{/* Search box removed to match v0.6 behavior - search is in sidebar only */}}
</div>
</nav>
126 changes: 126 additions & 0 deletions layouts/_partials/sidebar-tree.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{{ $context := .context -}}
{{ $sidebarRoot := .sidebarRoot -}}
{{ $sidebarRootID := .sidebarRootID -}}
{{ $cacheSidebar := .cacheSidebar -}}

{{ with $context -}}

{{/* When the sidebar is cached, "active" class is set client side. */ -}}
{{ $shouldDelayActive := $cacheSidebar -}}

<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}">
{{ if not .Site.Params.ui.sidebar_search_disable -}}

<form class="td-sidebar__search d-flex align-items-center">
{{ partial "search-input.html" . }}
<button class="hamburger" type="button" aria-label="Toggle Menu" data-bs-toggle="collapse" data-bs-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</form>
<div class="search-by-tag">
<a href="{{ "tags/" | relLangURL }}">...or browse by tag</a>
</div>

{{- else -}}

<div id="content-mobile">
<form class="td-sidebar__search d-flex align-items-center">
{{ partial "search-input.html" . }}
<button class="hamburger" type="button" aria-label="Toggle Menu" data-bs-toggle="collapse" data-bs-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</form>
</div>
<div id="content-desktop"></div>

{{- end }}
{{/* */ -}}

<nav class="td-sidebar-nav collapse
{{- if .Site.Params.ui.sidebar_search_disable }} td-sidebar-nav--search-disabled{{ end -}}
{{- if .Site.Params.ui.sidebar_menu_foldable }} foldable-nav{{ end }}" {{/**/ -}}
id="td-section-nav"
{{- if .Site.Params.ui.sidebar_root_enabled }} data-sidebar-root-id="{{ $sidebarRootID }}"{{ end -}}
>
{{ if and .Site.Params.ui.sidebar_lang_menu (gt (len .Site.Home.Translations) 0) -}}
<div class="td-sidebar-nav__section nav-item d-block d-lg-none">
{{ partial "navbar-lang-selector.html" . }}
</div>
{{ end -}}
{{/* Always use Site.Home as navRoot to show glossary terms on all pages (matching v0.6 behavior) */}}
{{/* Ignore $sidebarRoot to ensure terms are always shown in sidebar */}}
{{ $navRoot := .Site.Home -}}
{{ $ulNr := 0 -}}
{{ $ulShow := .Site.Params.ui.ul_show | default 1 -}}
{{ $sidebarMenuTruncate := .Site.Params.ui.sidebar_menu_truncate | default 100 -}}
<ul class="td-sidebar-nav__section pe-md-3 ul-{{ $ulNr }}">
{{ template "section-tree-nav-section" (dict "page" . "section" $navRoot "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" (add $ulShow 1)) }}
</ul>
</nav>
</div>

{{- end }}{{/* with $context */ -}}

{{ define "section-tree-nav-section" -}}
{{/* cSpell:ignore manuallink manuallinkrelref manuallinktitle */ -}}
{{ $s := .section -}}
{{ $p := .page -}}
{{ $shouldDelayActive := .shouldDelayActive -}}
{{ $sidebarMenuTruncate := .sidebarMenuTruncate -}}
{{ $treeRoot := cond (eq .ulNr 0) true false -}}
{{ $ulNr := .ulNr -}}
{{ $ulShow := .ulShow -}}
{{ $active := and (not $shouldDelayActive) (eq $s $p) -}}
{{ $activePath := and (not $shouldDelayActive) (or (eq $p $s) ($p.IsDescendant $s)) -}}
{{ $show := cond
(or
(lt $ulNr $ulShow)
$activePath
(and (not $shouldDelayActive) (eq $s.Parent $p.Parent))
(and (not $shouldDelayActive) (eq $s.Parent $p))
) true false
-}}
{{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) }}
{{/* Only show completed terms in sidebar (matching v0.6 behavior) */}}
{{ $pages := ( (where $s.Pages ".Params.status" "Completed") | union (where $s.Pages ".Params.status" "completed") ) | intersect (where $s.Pages ".Params.toc_hide" "!=" true) -}}
{{ $withChild := gt (len $pages) 0 -}}
{{ $manualLink := $s.RelPermalink -}}
{{ with $s.Params.manualLink -}}
{{ $manualLink = . -}}
{{ end -}}
{{ with $s.Params.manualLinkRelref -}}
{{ $manualLink = relref $s . -}}
{{ end -}}
{{ $manualLinkTitle := $s.LinkTitle -}}
{{ with $s.Params.manualLinkTitle -}}
{{ $manualLinkTitle = . -}}
{{ end -}}

<li class="td-sidebar-nav__section-title td-sidebar-nav__section{{ if $withChild }} with-child{{ else }} without-child{{ end }}{{ if $activePath }} active-path{{ end }}{{ if (not (or $show $p.Site.Params.ui.sidebar_menu_foldable )) }} collapse{{ end }}" id="{{ $mid }}-li">
{{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}}
<input type="checkbox" id="{{ $mid }}-check"{{ if $activePath}} checked{{ end }}/>
<label for="{{ $mid }}-check"><a href="{{ $manualLink }}"{{ if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end }}{{ with $s.Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }} class="align-left ps-0 {{ if $active}} active{{ end }} td-sidebar-link{{ if $s.IsPage }} td-sidebar-link__page{{ else }} td-sidebar-link__section{{ end }}{{ if $treeRoot }} tree-root{{ end }}" id="{{ $mid }}"><span class="{{ if $active }}td-sidebar-nav-active-item{{ end }}">{{ $s.LinkTitle }}</span></a></label>
{{ else -}}
{{ if not $treeRoot }}
<a href="{{ $manualLink }}"{{ if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end }}{{ with $s.Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }} class="align-left ps-0{{ if $active}} active{{ end }} td-sidebar-link{{ if $s.IsPage }} td-sidebar-link__page{{ else }} td-sidebar-link__section{{ end }}{{ if $treeRoot }} tree-root{{ end }}" id="{{ $mid }}"><span class="{{ if $active }}td-sidebar-nav-active-item{{ end }}">{{ $s.LinkTitle }}</span></a>
{{- end }}
{{- end }}
{{- if $withChild }}
<ul class="ul-{{ add $ulNr 1 }}{{ if (not (or $show $p.Site.Params.ui.sidebar_menu_foldable )) }} collapse{{ end }}">
{{ range $pages.ByTitle -}}
{{ if (le (len .Title) $sidebarMenuTruncate) -}}
{{ template "section-tree-nav-section" (dict "page" $p "section" . "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" (add $ulNr 1) "ulShow" $ulShow) }}
{{ else -}}
{{ if $p.Site.Params.ui.sidebar_menu_truncate_warn -}}
{{ warnf "%.40s title [%.40s] > ui.sidebar_menu_truncate: title has %d chars which is > %d. Consider trimming. See https://www.docsy.dev/docs/adding-content/navigation/#menu-size-limit" .Path .Title (len .Title) $sidebarMenuTruncate -}}
{{ end -}}
{{ end -}}
{{ end -}}
</ul>
{{- end }}
</li>
{{ end -}}
2 changes: 2 additions & 0 deletions layouts/partials/hooks/body-end.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{/* Custom scripts loaded at the end of body */}}
<script src="{{ "js/search.js" | relURL }}"></script>
13 changes: 0 additions & 13 deletions layouts/partials/navbar-lang-selector.html

This file was deleted.

42 changes: 0 additions & 42 deletions layouts/partials/navbar.html

This file was deleted.

45 changes: 0 additions & 45 deletions layouts/partials/page-meta-links.html

This file was deleted.

Loading