Skip to content

Commit dccedfe

Browse files
authored
Merge pull request #1550 from gethinode/develop
Develop
2 parents c068f7f + d3ee135 commit dccedfe

File tree

31 files changed

+568
-249
lines changed

31 files changed

+568
-249
lines changed

assets/js/critical/color.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if site.Params.main.enableDarkMode -}}
1+
{{- if (or site.Params.main.enableDarkMode site.Params.main.colorMode.enabled) -}}
22

33
/*!
44
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)

assets/scss/components/_navbar.scss

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88

99
.mode-switch {
10-
--#{$prefix}mode-switch-width: 50px;
10+
--#{$prefix}mode-switch-width: 3em;
1111
}
1212

1313
.mode-switch .label {
@@ -64,6 +64,18 @@
6464
transform: scale(0.8);
6565
}
6666

67+
.mode-toggle > input {
68+
z-index: 1;
69+
cursor: pointer;
70+
height: 25px;
71+
width: 25px;
72+
}
73+
74+
.mode-toggle > label {
75+
z-index: 0;
76+
cursor: pointer;
77+
}
78+
6779
// Source: https://jsfiddle.net/njhgr40m/
6880

6981
@if $enable-dark-mode {
@@ -126,6 +138,36 @@
126138

127139
.navbar-expanded {
128140
box-shadow: $box-shadow-sm;
141+
min-height: 100vh;
142+
align-items: start;
143+
}
144+
145+
.navbar-expanded .navbar-collapse {
146+
margin-top: 2rem;
147+
}
148+
149+
@each $h, $size in $font-sizes {
150+
.navbar-fs-#{$h} {
151+
font-size: #{$size};
152+
}
153+
}
154+
155+
@each $breakpoint in map-keys($grid-breakpoints) {
156+
$next: breakpoint-next($breakpoint, $grid-breakpoints);
157+
$infix: breakpoint-infix($next, $grid-breakpoints);
158+
159+
@if $infix != '' {
160+
@include media-breakpoint-up($next) {
161+
.navbar#{$infix}-fs {
162+
font-size: inherit;
163+
}
164+
}
165+
}
166+
}
167+
168+
.navbar-icon {
169+
padding-right: var(--bs-navbar-nav-link-padding-x);
170+
padding-left: var(--bs-navbar-nav-link-padding-x);
129171
}
130172

131173
.nav-item .vr {

assets/scss/components/_sidebar.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,6 @@
134134

135135
.dropdown-toggle {
136136
outline: 0;
137+
display: flex;
138+
align-items: center;
137139
}

config/_default/hugo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ home = ["HTML", "RSS", "REDIR", "netlify", "server"]
176176
[[module.imports]]
177177
path = "github.com/gethinode/mod-csp"
178178
[[module.imports]]
179-
path = "github.com/gethinode/mod-flexsearch/v2"
179+
path = "github.com/gethinode/mod-flexsearch/v3"
180180
[[module.imports]]
181181
path = "github.com/gethinode/mod-fontawesome/v2"
182182
[[module.imports]]

config/_default/params.toml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
[main]
33
separator = "-"
44
description = "Hinode is a clean documentation and blog theme for your Hugo site based on Bootstrap 5."
5-
enableDarkMode = true
65
enableLanguageSelectionStorage = false
7-
modes = ["light", "dark"]
86
canonifyAssetsURLs = false
97
endorse = true
108
footerBelowFold = false
@@ -22,6 +20,12 @@
2220
tab = false
2321
[main.build]
2422
transpiler = "libsass"
23+
[main.colorMode]
24+
enabled = true
25+
modes = ["light", "dark"]
26+
toggle = false
27+
iconLight = "fas sun"
28+
iconDark = "fas moon"
2529
# toml-docs-end main
2630

2731
# toml-docs-start images
@@ -91,8 +95,6 @@
9195
overlayMode = "dark"
9296
horizontal = false
9397
offset = "5.5rem"
94-
search = true
95-
searchModal = false
9698
breadcrumb = true
9799
toc = true
98100
sidebar = true
@@ -103,6 +105,12 @@
103105
[navigation.padding]
104106
x = 4
105107
y = 4
108+
[navigation.language]
109+
icon = "fas globe"
110+
[navigation.search]
111+
enabled = true
112+
modal = true
113+
icon = "fas magnifying-glass"
106114
# toml-docs-end navigation
107115

108116
# toml-docs-start messages

config/postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const purgecss = purgeCSSPlugin({
2727
'./assets/scss/theme/fonts.scss',
2828
'./assets/scss/theme/theme.scss',
2929
'./_vendor/github.com/gethinode/mod-cookieyes/v2/assets/scss/cookieyes.scss',
30-
'./_vendor/github.com/gethinode/mod-flexsearch/v2/assets/scss/modules/flexsearch/flexsearch.scss',
30+
'./_vendor/github.com/gethinode/mod-flexsearch/v3/assets/scss/modules/flexsearch/flexsearch.scss',
3131
'./_vendor/github.com/gethinode/mod-katex/dist/katex.scss',
3232
'./_vendor/github.com/gethinode/mod-leaflet/dist/leaflet.scss',
3333
'./_vendor/github.com/gethinode/mod-mermaid/v3/assets/scss/mermaid.scss',

content/_modals/_index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Modal elements
3+
cascade:
4+
- build:
5+
list: local
6+
publishResources: false
7+
render: never
8+
---

data/structures/navbar-item.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ arguments:
99
comment: Context of the current page.
1010
group: partial
1111
menu:
12-
type: '*navigation.MenuEntry'
12+
type:
13+
- '*navigation.MenuEntry'
14+
- 'map[string]interface {}'
1315
optional: false
1416
comment: Menu data to use for the navbar item.
1517
parent:
@@ -37,3 +39,24 @@ arguments:
3739
optional: true
3840
comment: >-
3941
Renders the navigation item as plain item, ignoring any children.
42+
breakpoint:
43+
release: v1.2.0
44+
modal:
45+
type: string
46+
optional: true
47+
release: v1.2.0
48+
comment: >-
49+
If set, toggles a modal control for the provided target.
50+
id:
51+
type: string
52+
optional: true
53+
release: v1.2.0
54+
comment: >-
55+
If set, adds an id attribute to the menu item.
56+
fs:
57+
type: int
58+
optional: true
59+
default: 6
60+
release: v1.2.0
61+
comment: >-
62+
Sets the font size of the navigation items when the navbar is collapsed.

exampleSite/config/_default/hugo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ home = ["HTML", "RSS", "REDIR", "netlify", "server"]
115115
[[module.imports]]
116116
path = "github.com/gethinode/mod-csp"
117117
[[module.imports]]
118-
path = "github.com/gethinode/mod-flexsearch/v2"
118+
path = "github.com/gethinode/mod-flexsearch/v3"
119119
[[module.imports]]
120120
path = "github.com/gethinode/mod-fontawesome/v2"
121121
[[module.imports]]

exampleSite/config/_default/params.toml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[main]
22
separator = "-"
33
description = "Hinode is a clean documentation and blog theme for your Hugo site based on Bootstrap 5."
4-
enableDarkMode = true
54
enableLanguageSelectionStorage = true
6-
modes = ["light", "dark"]
75
canonifyAssetsURLs = false
86
footerBelowFold = false
97
loading = "lazy"
@@ -21,6 +19,12 @@
2119
[main.build]
2220
transpiler = "dartsass"
2321
silenceDeprecations = true
22+
[main.colorMode]
23+
enabled = true
24+
modes = ["light", "dark"]
25+
toggle = true
26+
iconLight = "fas sun"
27+
iconDark = "fas moon"
2428

2529
[debugging]
2630
showJS = false
@@ -45,18 +49,23 @@
4549
horizontal = false
4650
offset = "5.5rem"
4751
offsetXS = "5.5rem"
48-
search = true
49-
searchModal = false
5052
breadcrumb = true
5153
toc = true
5254
sidebar = true
5355
size = "md"
56+
fontsizeCollapsed = 6
5457
startLevel = 2
5558
endLevel = 3
5659
maxNumHeadings = 9
60+
[navigation.language]
61+
icon = "fas globe"
5762
[navigation.padding]
5863
x = 4
5964
y = 4
65+
[navigation.search]
66+
enabled = true
67+
modal = false
68+
icon = "fas magnifying-glass"
6069

6170
[messages]
6271
placement = "bottom-right"

0 commit comments

Comments
 (0)