Skip to content

Commit afa6f99

Browse files
committed
migrate docsy 0.13.x
Signed-off-by: Junya Okabe <[email protected]> Signed-off-by: Junya Okabe <[email protected]>
1 parent f0235f2 commit afa6f99

File tree

12 files changed

+194
-174
lines changed

12 files changed

+194
-174
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ node_modules/
77
package-lock.json
88
pagefind
99
tmp/
10+
_vendor/
1011

1112
# Local Netlify folder
1213
.netlify

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ serve:
3636

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

4343
preview-build:
4444
npx hugo mod clean --all
45-
npx hugo mod get github.com/google/docsy@v0.6.0 github.com/google/docsy/[email protected].0
45+
npx hugo mod get github.com/google/docsy@v0.13.0
4646
npx hugo --minify \
4747
--baseURL $(DEPLOY_PRIME_URL) \
4848
--buildDrafts \

assets/scss/_header.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
height: 40px;
3636
}
3737
}
38+
// Hide text title since logo SVG already contains the title
39+
.navbar-brand__name {
40+
display: none;
41+
}
3842
}
3943

4044
// Main nav bar.

go.mod

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ module github.com/cncf/glossary
22

33
go 1.22
44

5+
require github.com/google/docsy v0.13.0
6+
57
require (
6-
github.com/google/docsy v0.6.0 // indirect
7-
github.com/google/docsy/dependencies v0.6.0 // indirect
8+
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 // indirect
9+
github.com/google/docsy/dependencies v0.7.2 // indirect
10+
github.com/twbs/bootstrap v5.3.8+incompatible // indirect
811
)

go.sum

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
2-
github.com/google/docsy v0.6.0 h1:43bVF18t2JihAamelQjjGzx1vO2ljCilVrBgetCA8oI=
3-
github.com/google/docsy v0.6.0/go.mod h1:VKKLqD8PQ7AglJc98yBorATfW7GrNVsn0kGXVYF6G+M=
4-
github.com/google/docsy/dependencies v0.6.0 h1:BFXDCINbp8ZuUGl/mrHjMfhCg+b1YX+hVLAA5fGW7Pc=
5-
github.com/google/docsy/dependencies v0.6.0/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE=
6-
github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
1+
github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
2+
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 h1:/iluJkJiyTAdnqrw3Yi9rH2HNHhrrtCmj8VJe7I6o3w=
3+
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
4+
github.com/google/docsy v0.7.2 h1:KzhFgTd3taF1jq9HDemH3omlUqn9qfdE68sxRyTySpM=
5+
github.com/google/docsy v0.7.2/go.mod h1:ol3w2s1FBUzENdKSAEeNjtuaISUzHYHTw60xv5QH3Dg=
6+
github.com/google/docsy v0.13.0 h1:Y1oy5SmQ0ikJJsvkuefEVZMj0MTXLmVfpXbt7Ytc7rc=
7+
github.com/google/docsy v0.13.0/go.mod h1:1Fj1W1O3esZh7IBQ8XAYtxtg10udBXuGI89+LUQc1AU=
8+
github.com/google/docsy/dependencies v0.7.2 h1:+t5ufoADQAj4XneFphz4A+UU0ICAxmNaRHVWtMYXPSI=
9+
github.com/google/docsy/dependencies v0.7.2/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4=
10+
github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
11+
github.com/twbs/bootstrap v5.3.8+incompatible h1:eK1fsXP7R/FWFt+sSNmmvUH9usPocf240nWVw7Dh02o=
12+
github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

layouts/_partials/navbar.html

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{{ $cover := and
2+
(.HasShortcode "blocks/cover")
3+
(not .Site.Params.ui.navbar_translucent_over_cover_disable)
4+
-}}
5+
{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
6+
7+
<nav class="td-navbar js-navbar-scroll
8+
{{- if $cover }} td-navbar-cover {{- end }}">
9+
<div class="td-navbar-container container-fluid flex-column flex-md-row">
10+
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
11+
{{- /**/ -}}
12+
<span class="navbar-brand__logo navbar-logo">
13+
{{- if ne .Site.Params.ui.navbar_logo false -}}
14+
{{ with resources.Get "icons/logo.svg" -}}
15+
{{ ( . | minify).Content | safeHTML -}}
16+
{{ end -}}
17+
{{ end -}}
18+
</span>
19+
{{- /**/ -}}
20+
<span class="navbar-brand__name">
21+
{{- .Site.Title -}}
22+
</span>
23+
{{- /**/ -}}
24+
</a>
25+
<div class="td-navbar-nav-scroll td-navbar-nav-scroll--indicator" id="main_navbar">
26+
<div class="scroll-indicator scroll-left"></div>
27+
<ul class="navbar-nav">
28+
{{ $p := . -}}
29+
{{ range .Site.Menus.main -}}
30+
<li class="nav-item">
31+
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
32+
{{ $href := "" -}}
33+
{{ with .Page -}}
34+
{{ $active = or $active ( $.IsDescendant .) -}}
35+
{{ $href = .RelPermalink -}}
36+
{{ else -}}
37+
{{ $href = .URL | relLangURL -}}
38+
{{ end -}}
39+
{{ $isExternal := ne $baseURL.Host (urls.Parse .URL).Host -}}
40+
<a {{/**/ -}}
41+
class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}}
42+
href="{{ $href }}"
43+
{{- if $isExternal }} target="_blank" rel="noopener" {{- end -}}
44+
>
45+
{{- .Pre -}}
46+
<span>{{ .Name }}</span>
47+
{{- .Post -}}
48+
</a>
49+
</li>
50+
{{ end -}}
51+
{{ if .Site.Params.versions -}}
52+
<li class="nav-item dropdown d-none d-lg-block td-navbar__version-menu">
53+
{{ partial "navbar-version-selector.html" . -}}
54+
</li>
55+
{{ end -}}
56+
{{ if (gt (len .Site.Home.Translations) 0) -}}
57+
<li class="nav-item td-navbar__lang-menu">
58+
{{ partial "navbar-lang-selector.html" . -}}
59+
</li>
60+
{{ end -}}
61+
{{- $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}}
62+
{{ if $darkMode.showMenu -}}
63+
<li class="nav-item td-navbar__light-dark-menu">
64+
{{ partial "theme-toggler" . }}
65+
</li>
66+
{{ end -}}
67+
</ul>
68+
<div class="scroll-indicator scroll-right"></div>
69+
</div>
70+
{{/* Search box removed to match v0.6 behavior - search is in sidebar only */}}
71+
</div>
72+
</nav>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{{/* Custom scripts loaded at the end of body */}}
2+
<script src="{{ "js/search.js" | relURL }}"></script>

layouts/partials/navbar-lang-selector.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

layouts/partials/navbar.html

Lines changed: 0 additions & 42 deletions
This file was deleted.

layouts/partials/page-meta-links.html

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)