Compare commits

...

27 Commits

Author SHA1 Message Date
Mark Dumay
511ad2cb4c Merge pull request #198 from gethinode/develop
Navbar
2023-04-06 06:21:07 +02:00
mark
b87a91f6df Fix #128 2023-04-06 06:17:30 +02:00
mark
11b8bb4c69 Bump release version 2023-04-06 06:05:00 +02:00
mark
84fab6b8a8 Improve alignment of navbar elements 2023-04-06 06:04:29 +02:00
Mark Dumay
656770352a Merge pull request #197 from gethinode/develop
Configurable sidebar version
2023-04-05 13:17:07 +02:00
mark
1dadce3f92 Bump release version 2023-04-05 13:11:57 +02:00
mark
8d428d3b51 Make sidebar version configurable 2023-04-05 13:11:28 +02:00
Mark Dumay
8de8204f0e Merge pull request #196 from gethinode/develop
Clean up
2023-04-05 09:20:30 +02:00
mark
e5d2ece0b7 Bump release version 2023-04-05 09:16:00 +02:00
mark
01159ceea2 Remove debug statement 2023-04-05 09:10:07 +02:00
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
13 changed files with 1738 additions and 731 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

@@ -24,6 +24,10 @@
border: 0 if($enable-important-utilities, !important, null);
}
.fw-30 {
width: 30px !important;
}
/* Lines of the Toggler */
.toggler-icon {
width: 30px;

View File

@@ -3,8 +3,22 @@
top: $navbar-offset;
}
.sidebar-overflow {
top: $navbar-offset;
max-height: 90vh;
overflow-y: auto;
}
.sidebar-item {
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

@@ -1,4 +1,6 @@
{{- $section := .Section }}
{{- with partial "utilities/GetMenu" . }}{{ $.Scratch.Set "sidebar" . }}{{ end -}}
{{ $.Scratch.Set "version" (site.Param (printf "%s.version" .Section)) }}
<!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js" data-bs-theme="dark">

View File

@@ -69,6 +69,7 @@
{{ define "main" -}}
{{- $menu := .Scratch.Get "sidebar" -}}
{{- $version := .Scratch.Get "version" -}}
{{- $sidebar := .Site.Params.navigation.sidebar | default true -}}
{{ if and $menu $sidebar -}}
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvass-sidebar" aria-labelledby="offcanvas-label">
@@ -77,21 +78,21 @@
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
{{ partial "assets/sidebar" (dict "page" . "menu" $menu) }}
{{ partial "assets/sidebar" (dict "page" . "menu" $menu "version" $version) }}
</div>
</div>
<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">
{{ partial "assets/sidebar" (dict "page" . "menu" $menu) }}
<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 "version" $version) }}
</div>
<div class="col col-md-9 col-lg-8 mb-5 p-4">
{{ partial "partials/header.html" . }}
{{ 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

@@ -79,19 +79,21 @@
{{- $pre := .Pre -}}
{{- $post := .Post -}}
<nav class="navbar navbar-expand-{{ $size }} {{ with $color }}bg-{{ . }}{{ end }} {{ if $fixed }}fixed-top{{ end }} p-3">
<div class="container-fluid">
<nav class="navbar navbar-expand-{{ $size }} {{ with $color }}bg-{{ . }}{{ end }} {{ if $fixed }}fixed-top{{ end }} p-4">
<div class="container-fluid p-0">
<!-- Insert sidebar toggler when applicable -->
<div class="d-flex">
{{- if $page.Scratch.Get "sidebar" -}}
<button class="navbar-toggler collapsed ms-n3" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvass-sidebar" aria-controls="offcanvass-sidebar" aria-label="{{ T "toggleSidebar" }}">
<button class="navbar-toggler fw-30 collapsed p-0 mx-auto" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvass-sidebar" aria-controls="offcanvass-sidebar" aria-label="{{ T "toggleSidebar" }}">
{{- partial "assets/icon.html" (dict "icon" "fas ellipsis") -}}
</button>
{{- else -}}
<!-- Insert invisible sidebar toggler to center logo correctly on smaller screens -->
<button class="navbar-toggler collapsed ms-n3 invisible" type="button">
<button class="navbar-toggler fw-30 collapsed p-0 mx-auto invisible" type="button">
{{- partial "assets/icon.html" (dict "icon" "fas ellipsis") -}}
</button>
{{- end -}}
</div>
<!-- Insert the brand logo or name -->
<a class="navbar-brand mx-auto" href="{{ site.Home.RelPermalink }}">
@@ -103,12 +105,14 @@
</a>
<!-- Insert main navigation toggler -->
<button id="main-nav-toggler" class="navbar-toggler collapsed me-n3" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent-{{ $id }}"
<div class="d-flex fw-30">
<button id="main-nav-toggler" class="navbar-toggler collapsed p-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent-{{ $id }}"
aria-controls="navbarSupportedContent-{{ $id }}" aria-expanded="false" aria-label="{{ T "toggleMainNav" }}">
<span class="toggler-icon top-bar emphasis"></span>
<span class="toggler-icon middle-bar emphasis"></span>
<span class="toggler-icon bottom-bar emphasis"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="navbarSupportedContent-{{ $id }}">
<!-- Insert search input -->
@@ -130,7 +134,8 @@
</a>
<ul class="dropdown-menu dropdown-menu-end">
{{- range .Children -}}
<li><a class="dropdown-item" href="{{ .URL }}">{{ .Name }}</a></li>
{{- $child_active := eq $page_url .URL -}}
<li><a class="dropdown-item {{ if $child_active }}active{{ end }}" href="{{ .URL }}">{{ .Name }}</a></li>
{{- end -}}
</ul>
</li>
@@ -159,7 +164,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 +184,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

@@ -1,58 +1,110 @@
{{- $page := .page }}
{{- $section := $page.Section }}
{{- $data := .menu -}}
{{- $version := .version -}}
{{ 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) -}}
{{- $sectionBreak := false }}
{{- define "partials/sidebar/group.html" -}}
{{- $page := .page -}}
{{- $index := .index -}}
{{- $level := .level -}}
{{- $baseURL := .baseURL -}}
{{- $group := .group -}}
<ul class="list-unstyled ps-0">
{{- range $index, $group := $data -}}
{{- $link := $group.title -}}
{{- $link_slug := $link | urlize -}}
{{- $doc_slug := $group.title | urlize -}}
{{- $href := printf "%s/" (relLangURL (path.Join $baseURL $doc_slug)) -}}
{{- $collapsed := strings.HasPrefix $page.RelPermalink $href -}}
{{- 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 }}
{{- $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 }}">
<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 $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>
<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>
{{- else }}
{{ 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>
{{- $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 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" aria-label="{{ (strings.FirstUpper $section) }} navigation">
{{- $sectionBreak := false -}}
{{- $level := 0 -}}
{{- $baseURL := relLangURL (path.Join $section $version) }}
<ul class="list-unstyled ps-0">
{{- range $index, $item := $data -}}
{{- if $item.pages }}
{{- $sectionBreak = true }}
{{ partial "partials/sidebar/group.html" (dict
"page" $page
"index" $index
"level" (add $level 1)
"baseURL" $baseURL
"group" $item
)
}}
{{- else }}
{{ 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 }}

2170
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.3",
"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"
}
}