Compare commits

...

17 Commits

Author SHA1 Message Date
Mark Dumay
d6357b70ae Merge pull request #195 from gethinode/develop
Multi-level sidebar nav
2023-04-05 09:05:08 +02:00
mark
eb000e9f81 Fix linting issues 2023-04-05 08:51:38 +02:00
mark
efe9c2e06e Bump release version 2023-04-05 08:39:41 +02:00
mark
4c41cbcafb Enable nested sidebar navigation 2023-04-05 08:39:24 +02:00
mark
1910af163d Move API to enable utilities in theme styles 2023-04-05 08:31:21 +02:00
Mark Dumay
cba1566ba1 Merge pull request #194 from gethinode/develop
Bump dependencies
2023-04-03 15:27:27 +02:00
mark
69abe3ec0c Bump dependencies 2023-04-03 15:19:08 +02:00
Mark Dumay
9961d8e364 Merge pull request #193 from gethinode/develop
Dependencies
2023-04-03 15:04:09 +02:00
mark
7b1f81cd9a Bump Bootstrap to v5.3.0-alpha3 2023-04-03 14:17:06 +02:00
mark
1dd91da4f5 Fix dummy links 2023-04-03 14:14:03 +02:00
mark
624d89118d Use hugo-bin to simplify hugo installation 2023-04-03 14:12:52 +02:00
mark
ddab72c463 Fix #189 2023-04-03 13:42:02 +02:00
Mark Dumay
c95ccd22eb Merge pull request #192 from gethinode/main
Sync with main
2023-04-03 11:51:41 +02:00
Mark Dumay
ced7196084 Merge pull request #191 from gethinode/sass
Sidebar
2023-04-03 11:45:39 +02:00
mark
9c726191de Bump release version 2023-04-03 11:39:57 +02:00
mark
93a6fab67f Fix #190 2023-04-03 11:38:48 +02:00
Mark Dumay
18d4548b8d Merge pull request #186 from gethinode/main
Sync with main branch
2023-04-01 14:02:50 +02:00
11 changed files with 1702 additions and 707 deletions

View File

@@ -53,9 +53,6 @@
// Import Bootstrap helpers
@import "bootstrap/scss/helpers";
// Import Bootstrap utilities
@import "bootstrap/scss/utilities/api";
// Import Font Awesome
// scss-docs-start awesome
@import "@fortawesome/fontawesome-free/scss/fontawesome";
@@ -98,3 +95,6 @@
// Import theme placeholder
@import "theme/theme.scss";
// Import Bootstrap utilities API
@import "bootstrap/scss/utilities/api";

View File

@@ -3,8 +3,22 @@
top: $navbar-offset;
}
.sidebar-overflow {
top: $navbar-offset;
max-height: 90vh;
overflow-y: auto;
}
.sidebar-item {
color: black;
color: rgba(0, 0, 0, 0.65);
margin-left: 0 !important;
padding-left: 0.85rem !important;
&.active,
&:hover,
&:focus {
color: black;
}
}
.btn-toggle {
@@ -55,6 +69,14 @@
@include color-mode(dark) {
.sidebar-item {
color: var(--bs-tertiary-color);
margin-left: 0 !important;
padding-left: 0.85rem !important;
&.active,
&:hover,
&:focus {
color: var(--bs-secondary-color);
}
}
.btn-toggle {

View File

@@ -24,7 +24,7 @@
logo = "/img/logo_icon.svg"
color = "body"
fixed = true
offset = "4em"
offset = "5em"
search = true
breadcrumb = false
toc = true

View File

@@ -73,7 +73,7 @@ As an example, the following shortcode displays a tooltip for a dark button with
<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* button color="secondary" tooltip="Click on the inbox to view your unread messages" href="#" badge="99+" */>}}
{{</* button color="secondary" tooltip="Click on the inbox to view your unread messages" href="#!" badge="99+" */>}}
Inbox
{{</* /button */>}}
{{< /example>}}
@@ -86,9 +86,9 @@ As an example, the following shortcode displays a group of three buttons.
<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* button-group aria-label="Basic example" */>}}
{{</* button color="primary" href="#" */>}}Left{{</* /button */>}}
{{</* button color="primary" href="#" */>}}Middle{{</* /button */>}}
{{</* button color="primary" href="#" */>}}Right{{</* /button */>}}
{{</* button color="primary" href="#!" */>}}Left{{</* /button */>}}
{{</* button color="primary" href="#!" */>}}Middle{{</* /button */>}}
{{</* button color="primary" href="#!" */>}}Right{{</* /button */>}}
{{</* /button-group */>}}
{{< /example >}}
<!-- markdownlint-enable MD037 -->
@@ -236,7 +236,7 @@ As an example, the following shortcode displays a tooltip for a colored hyperlin
<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* tooltip color="primary" title="Tooltip" href="#" */>}}
{{</* tooltip color="primary" title="Tooltip" href="#!" */>}}
Tooltip demonstration
{{</* /tooltip */>}}
{{< /example >}}

View File

@@ -73,7 +73,7 @@ De volgende shortcode toont een knop met een label en een aanwijzing.
<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* button color="secondary" tooltip="Toon je ongelezen berichten" href="#" badge="99+" */>}}
{{</* button color="secondary" tooltip="Toon je ongelezen berichten" href="#!" badge="99+" */>}}
Inbox
{{</* /button */>}}
{{< /example>}}
@@ -86,9 +86,9 @@ De volgende shortcode toont een groep van drie knoppen.
<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* button-group aria-label="Basic example" */>}}
{{</* button color="primary" href="#" */>}}Links{{</* /button */>}}
{{</* button color="primary" href="#" */>}}Midden{{</* /button */>}}
{{</* button color="primary" href="#" */>}}Rechts{{</* /button */>}}
{{</* button color="primary" href="#!" */>}}Links{{</* /button */>}}
{{</* button color="primary" href="#!" */>}}Midden{{</* /button */>}}
{{</* button color="primary" href="#!" */>}}Rechts{{</* /button */>}}
{{</* /button-group */>}}
{{< /example >}}
<!-- markdownlint-enable MD037 -->
@@ -236,7 +236,7 @@ De volgende shortcode toont een uitleg voor een gekleurde link.
<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* tooltip color="primary" title="Tooltip" href="#" */>}}
{{</* tooltip color="primary" title="Tooltip" href="#!" */>}}
Tooltip demonstration
{{</* /tooltip */>}}
{{< /example >}}

View File

@@ -83,7 +83,7 @@
<div class="container-fluid">
<div class="row row-cols-md-2 row-cols-lg-3">
<div class="col col-md-3 col-lg-2 d-none mt-5 d-md-block">
<div class="col col-md-3 col-lg-2 d-none pt-5 d-md-block sidebar-overflow sticky-top">
{{ partial "assets/sidebar" (dict "page" . "menu" $menu) }}
</div>
<div class="col col-md-9 col-lg-8 mb-5 p-4">
@@ -91,7 +91,7 @@
{{ partial "partials/body.html" . }}
{{ partial "partials/footer.html" . }}
</div>
<div class="col col-lg-2 d-none d-lg-block mt-5">
<div class="col col-lg-2 d-none d-lg-block pt-5">
{{- if and .Site.Params.navigation.toc .Params.includeToc | default true -}}
{{ partial "assets/toc.html" . -}}
{{ end -}}

View File

@@ -159,7 +159,7 @@
{{- if $enableLanguage -}}
{{- $currentLang := $page.Language.Lang -}}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<a class="nav-link dropdown-toggle" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false">
{{- partial "assets/icon.html" (dict "icon" "fas globe") }} {{ T "languageSwitcherLabel" }}
</a>
<ul class="dropdown-menu dropdown-menu-end ">
@@ -179,7 +179,7 @@
<!-- Insert color mode switcher -->
{{- if $enableDarkMode -}}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false" id="navbar-color-theme">
<a class="nav-link dropdown-toggle" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false" id="navbar-color-theme">
{{- partial "assets/icon.html" (dict "icon" "fas sun theme-icon-active") }}
<span class="d-md-none"></span>
</a>

View File

@@ -2,57 +2,109 @@
{{- $section := $page.Section }}
{{- $data := .menu -}}
{{- define "partials/sidebar/group.html" -}}
{{- $page := .page -}}
{{- $index := .index -}}
{{- $level := .level -}}
{{- $baseURL := .baseURL -}}
{{- $group := .group -}}
{{- $doc_slug := $group.title | urlize -}}
{{- $href := printf "%s/" (relLangURL (path.Join $baseURL $doc_slug)) -}}
{{ $collapsed := strings.HasPrefix $page.RelPermalink $href }}
{{ warnf "Page: %s" $href }}
<li class="mb-1">
<button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed" data-bs-toggle="collapse" data-bs-target="#sidebar-collapse-{{ $index }}-{{ $level }}" aria-expanded="{{ if $collapsed }}true{{ else }}false{{ end }}">
<div class="text-start flex-fill">{{ $group.title }}</div>
</button>
<div class="collapse {{ if $collapsed }}show{{ end }}" id="sidebar-collapse-{{ $index }}-{{ $level }}">
<ul class="btn-toggle-nav list-unstyled fw-normal {{ if eq $level 0}} pb-1 {{ end }}ps-3">
{{- range $item := $group.pages -}}
{{- if $item.pages -}}
{{ partial "partials/sidebar/group.html" (dict
"page" $page
"index" $index
"level" (add $level 1)
"baseURL" $href
"group" $item
)
}}
{{- else -}}
{{ partial "partials/sidebar/item.html" (dict
"page" $page
"sectionBreak" false
"level" $level
"baseURL" $href
"title" $item.title
)
}}
{{ end -}}
{{- end }}
</ul>
</div>
</li>
{{ end -}}
{{- define "partials/sidebar/item.html" -}}
{{ $page := .page }}
{{ $sectionBreak := .sectionBreak }}
{{- $level := .level -}}
{{ $baseURL := .baseURL}}
{{ $title := .title}}
{{- $doc_slug := $title | urlize -}}
{{- $href := printf "%s/" (relLangURL (path.Join $baseURL $doc_slug)) -}}
{{ $active := eq $page.RelPermalink $href }}
{{ if eq $level 0}}
<li class="mt-1 mb-1 {{ if $sectionBreak }}border-top{{ end }}"></li>
{{- $sectionBreak = false }}
<li>
<ul class="btn-toggle-nav list-unstyled fw-bold pb-1">
<li>
<a href="{{ $href }}" class="sidebar-item text-decoration-none rounded {{ if $active }}active{{ end }}">
{{ $title }}
</a>
</li>
</ul>
</li>
{{ else }}
<li>
<a href="{{ $href }}" class="sidebar-item text-decoration-none rounded small {{ if $active }}active{{ end }}">
{{ $title }}
</a>
</li>
{{ end }}
{{ end -}}
{{ if $data }}
<nav class="sidebar flex-shrink-0 ps-1 pt-3 sticky-top" aria-label="{{ (strings.FirstUpper $section) }} navigation">
{{- $url := split $page.Permalink "/" -}}
{{- $page_slug := index $url (sub (len $url) 2) -}}
<nav class="sidebar flex-shrink-0 ps-1 pt-3" aria-label="{{ (strings.FirstUpper $section) }} navigation">
{{- $sectionBreak := false }}
{{ $level := 0}}
{{ $baseURL := relLangURL (path.Join $section site.Params.docs.version) }}
<ul class="list-unstyled ps-0">
{{- range $index, $group := $data -}}
{{- $link := $group.title -}}
{{- $link_slug := $link | urlize -}}
{{- if $group.pages -}}
{{- $link = index $group.pages 0 -}}
{{- $link_slug = $link.title | urlize -}}
{{- end -}}
{{- $group_slug := $group.title | urlize -}}
{{- $is_active_group := eq $page.Params.group $group_slug -}}
{{- if $group.pages }}
{{- range $index, $item := $data -}}
{{- if $item.pages }}
{{- $sectionBreak = true }}
<li class="mb-1">
<button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed" data-bs-toggle="collapse" data-bs-target="#sidebar-collapse-{{ $index }}" aria-expanded="{{ if $is_active_group }}true{{ else }}false{{ end }}">
<div class="text-start flex-fill">{{ $group.title }}</div>
</button>
<div class="collapse {{ if $is_active_group }}show{{ end }}" id="sidebar-collapse-{{ $index }}">
<ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
{{- range $doc := $group.pages -}}
{{- $doc_slug := $doc.title | urlize -}}
{{- $is_active := and $is_active_group (eq $page_slug $doc_slug) -}}
{{- $href := relLangURL (path.Join $section site.Params.docs.version $group_slug $doc_slug) -}}
<li><a href="{{ $href }}" class="d-inline-flex sidebar-item text-decoration-none rounded {{ if $is_active }}active{{ end }}">{{ $doc.title }}</a></li>
{{- end }}
</ul>
</div>
</li>
{{ partial "partials/sidebar/group.html" (dict
"page" $page
"index" $index
"level" (add $level 1)
"baseURL" $baseURL
"group" $item
)
}}
{{- else }}
<li class="mt-1 mb-1 {{ if $sectionBreak }}border-top{{ end }}"></li>
{{- $sectionBreak = false }}
<li>
<ul class="btn-toggle-nav list-unstyled fw-bold pb-1">
<li>
{{- $doc_slug := $group.title | urlize -}}
{{- $is_active := and $is_active_group (eq $page_slug $doc_slug) -}}
{{- $href := relLangURL (path.Join $section site.Params.docs.version $doc_slug) -}}
<a href="{{ $href }}" class="d-inline-flex sidebar-item text-decoration-none rounded {{ if $is_active }}active{{ end }}">
{{ $group.title }}
</a>
</li>
</ul>
</li>
{{ partial "partials/sidebar/item.html" (dict
"page" $page
"sectionBreak" $sectionBreak
"level" $level
"baseURL" $baseURL
"title" $item.title
)
}}
{{- end }}
{{- end }}
</ul>

View File

@@ -19,8 +19,9 @@
{{- if $src -}}
<div class="carousel-item {{ if eq .Ordinal 0 }}active{{ end }}">
{{ partial "image.html" (dict "url" $src "ratio" $ratio "innerClass" "d-block w-100") }}
<div class="carousel-caption gradient"></div>
{{ with $caption }}
<div class="carousel-caption d-none d-md-block gradient">
<div class="carousel-caption d-none d-md-block">
<div class="d-flex justify-content-center align-items-end h-100 w-100 p-4">{{ . }}</div>
</div>
{{ end }}

2174
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.10.0-alpha5",
"version": "0.11.0",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
@@ -17,11 +17,11 @@
},
"scripts": {
"prestart": "npm run clean",
"start": "exec-bin node_modules/.bin/hugo/hugo server --bind=0.0.0.0 --disableFastRender",
"start:prod": "exec-bin node_modules/.bin/hugo/hugo server --bind=0.0.0.0 --disableFastRender -e production",
"start": "hugo server --bind=0.0.0.0 --disableFastRender",
"start:prod": "hugo server --bind=0.0.0.0 --disableFastRender -e production",
"prebuild": "npm run clean",
"build": "exec-bin node_modules/.bin/hugo/hugo --gc --minify",
"build:debug": "exec-bin node_modules/.bin/hugo/hugo -e debug --debug",
"build": "hugo --gc --minify",
"build:debug": "hugo -e debug --debug",
"build:preview": "npm run build -D -F",
"clean": "rimraf public resources",
"clean:install": "rimraf package-lock.json node_modules",
@@ -31,14 +31,13 @@
"lint:markdown": "markdownlint-cli2 \"*.md\" \"content/**/*.md\"",
"lint:markdown-fix": "markdownlint-cli2-fix \"*.md\" \"content/**/*.md\"",
"test": "npm run -s lint",
"env": "exec-bin node_modules/.bin/hugo/hugo env",
"env": "hugo env",
"precheck": "npm version",
"check": "exec-bin node_modules/.bin/hugo/hugo version",
"check": "hugo version",
"copy:fonts": "shx cp ./node_modules/@fortawesome/fontawesome-free/webfonts/* ./static/fonts/",
"create:syntax-light": "exec-bin node_modules/.bin/hugo/hugo gen chromastyles --style=github > ./assets/scss/components/_syntax-light.scss",
"create:syntax-dark": "exec-bin node_modules/.bin/hugo/hugo gen chromastyles --style=github-dark > ./assets/scss/components/_syntax-dark.scss",
"create:syntax-light": "hugo gen chromastyles --style=github > ./assets/scss/components/_syntax-light.scss",
"create:syntax-dark": "hugo gen chromastyles --style=github-dark > ./assets/scss/components/_syntax-dark.scss",
"create:syntax": "npm run -s create:syntax-light & npm run -s create:syntax-dark",
"postinstall": "hugo-installer --version otherDependencies.hugo --extended --destination node_modules/.bin/hugo",
"upgrade": "npx npm-check-updates -u"
},
"repository": {
@@ -55,7 +54,7 @@
"@fortawesome/fontawesome-free": "^6.4.0",
"@fullhuman/postcss-purgecss": "^5.0.0",
"autoprefixer": "^10.4.14",
"bootstrap": "^5.3.0-alpha2",
"bootstrap": "^5.3.0-alpha3",
"cssnano": "^6.0.0",
"cssnano-preset-advanced": "^6.0.0",
"eslint": "^8.37.0",
@@ -63,9 +62,8 @@
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"exec-bin": "^1.0.0",
"flexsearch": "^0.7.31",
"hugo-installer": "^4.0.1",
"hugo-bin": "^0.102.0",
"markdownlint-cli2": "^0.6.0",
"postcss-cli": "^10.1.0",
"purgecss-whitelister": "^2.4.0",
@@ -74,7 +72,7 @@
"stylelint": "^15.4.0",
"stylelint-config-standard-scss": "^7.0.1"
},
"otherDependencies": {
"hugo": "0.111.3"
"hugo-bin": {
"buildTags": "extended"
}
}