mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-11 03:53:08 +00:00
Compare commits
88 Commits
v0.14.5
...
v0.15.0-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c44340ef9e | ||
![]() |
8dfe0cb9d4 | ||
![]() |
fdb8287951 | ||
![]() |
f4f9b7c754 | ||
![]() |
4bb5ba728a | ||
![]() |
bdb8c43fb9 | ||
![]() |
63e51006ed | ||
![]() |
37b623e48c | ||
![]() |
27019594ca | ||
![]() |
d4ee11b7a5 | ||
![]() |
009314943b | ||
![]() |
826b5f58d8 | ||
![]() |
f6fb80d690 | ||
![]() |
8ed98bc5b4 | ||
![]() |
0cc3775370 | ||
![]() |
7be81f4393 | ||
![]() |
869f696a67 | ||
![]() |
c6d942b350 | ||
![]() |
18275acc80 | ||
![]() |
a85540f8de | ||
![]() |
3c93828d4f | ||
![]() |
8ca629978f | ||
![]() |
d99d416838 | ||
![]() |
b58a69b2ad | ||
![]() |
49d7736e1a | ||
![]() |
04531b6158 | ||
![]() |
b7fb9fb05b | ||
![]() |
4a78bd9e6b | ||
![]() |
4d0007a26b | ||
![]() |
ac7e564857 | ||
![]() |
f804ab747c | ||
![]() |
cfd292ddff | ||
![]() |
d4b0c379e2 | ||
![]() |
60ebd5fd41 | ||
![]() |
19a4398c90 | ||
![]() |
841c2e397f | ||
![]() |
3f42d781ec | ||
![]() |
dd9fcc6cbd | ||
![]() |
70aed1ed63 | ||
![]() |
1c635c814c | ||
![]() |
ff1c8ff056 | ||
![]() |
44c70f4036 | ||
![]() |
28f13f8385 | ||
![]() |
849d481cd6 | ||
![]() |
a0987e33a9 | ||
![]() |
f5dae5caa2 | ||
![]() |
d640ed1f8e | ||
![]() |
0c46c0080e | ||
![]() |
7319a3f9e3 | ||
![]() |
2e6ba557c8 | ||
![]() |
1d24b8ff0e | ||
![]() |
df307be37c | ||
![]() |
5d09963bb5 | ||
![]() |
8ce05d0c41 | ||
![]() |
5e03d80944 | ||
![]() |
65bdc8bb32 | ||
![]() |
558eed95ef | ||
![]() |
a17ed9b14a | ||
![]() |
06c5a97e3b | ||
![]() |
269d7c6bcf | ||
![]() |
fc2a43b8b9 | ||
![]() |
9c14411a3b | ||
![]() |
529e402267 | ||
![]() |
4a8ecaad19 | ||
![]() |
d13013189c | ||
![]() |
b21b412f16 | ||
![]() |
b3ad43768c | ||
![]() |
9ea9a6c616 | ||
![]() |
188129f19b | ||
![]() |
8a83f7345a | ||
![]() |
65cd47b1db | ||
![]() |
7e7cc41603 | ||
![]() |
7318d3cacb | ||
![]() |
ff928d035a | ||
![]() |
9341a98ab7 | ||
![]() |
206558e21e | ||
![]() |
8ecf38befc | ||
![]() |
afb3bbff9d | ||
![]() |
a7f871f954 | ||
![]() |
5d368ecaaa | ||
![]() |
2e40bd6be0 | ||
![]() |
21ae80d491 | ||
![]() |
6292be190e | ||
![]() |
a7c5c613c2 | ||
![]() |
480981d867 | ||
![]() |
abfa80d5a2 | ||
![]() |
08531514d3 | ||
![]() |
d4c321fee4 |
27
.github/release.yml
vendored
Normal file
27
.github/release.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
changelog:
|
||||||
|
exclude:
|
||||||
|
labels:
|
||||||
|
- skip-changelog
|
||||||
|
categories:
|
||||||
|
- title: ❗ Breaking Changes
|
||||||
|
labels:
|
||||||
|
- Semver-Major
|
||||||
|
- breaking-change
|
||||||
|
- title: 🚀 Highlights
|
||||||
|
labels:
|
||||||
|
- release-highlight
|
||||||
|
- title: 🎉 New Features
|
||||||
|
labels:
|
||||||
|
- Semver-Minor
|
||||||
|
- enhancement
|
||||||
|
- title: 🐛 Bug fixes
|
||||||
|
labels:
|
||||||
|
- fix
|
||||||
|
- bugfix
|
||||||
|
- bug
|
||||||
|
- title: 📦 Dependencies
|
||||||
|
labels:
|
||||||
|
- dependencies
|
||||||
|
- title: 🧰 Other Changes
|
||||||
|
labels:
|
||||||
|
- "*"
|
14
assets/js/alert.js
Normal file
14
assets/js/alert.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
const alert = document.getElementById('page-alert')
|
||||||
|
const closeBtn = document.getElementById('page-alert-btn-close')
|
||||||
|
if (alert !== null && closeBtn !== null) {
|
||||||
|
const version = alert.getAttribute('data-page-alert-version') || 'unknown'
|
||||||
|
const hideAlert = sessionStorage.getItem(`page-alert-${version}`) !== null
|
||||||
|
if (hideAlert) {
|
||||||
|
alert.classList.add('d-none')
|
||||||
|
}
|
||||||
|
|
||||||
|
closeBtn.addEventListener('click', () => {
|
||||||
|
sessionStorage.setItem(`page-alert-${version}`, 'seen')
|
||||||
|
alert.classList.add('d-none')
|
||||||
|
})
|
||||||
|
}
|
@@ -62,6 +62,7 @@
|
|||||||
// scss-docs-end awesome
|
// scss-docs-end awesome
|
||||||
|
|
||||||
// Import Hinode theme styles
|
// Import Hinode theme styles
|
||||||
|
@import "components/alert.scss";
|
||||||
@import "components/blockquote.scss";
|
@import "components/blockquote.scss";
|
||||||
@import "components/buttons.scss";
|
@import "components/buttons.scss";
|
||||||
@import "components/card.scss";
|
@import "components/card.scss";
|
||||||
@@ -71,6 +72,7 @@
|
|||||||
@import "components/comments.scss";
|
@import "components/comments.scss";
|
||||||
@import "components/navbar.scss";
|
@import "components/navbar.scss";
|
||||||
@import "components/img.scss";
|
@import "components/img.scss";
|
||||||
|
@import "components/pagination.scss";
|
||||||
@import "components/persona.scss";
|
@import "components/persona.scss";
|
||||||
@import "components/popover.scss";
|
@import "components/popover.scss";
|
||||||
@import "components/search.scss";
|
@import "components/search.scss";
|
||||||
|
3
assets/scss/components/_alert.scss
Normal file
3
assets/scss/components/_alert.scss
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.alert-no-decoration {
|
||||||
|
--bs-alert-border-radius: none;
|
||||||
|
}
|
11
assets/scss/components/_pagination.scss
Normal file
11
assets/scss/components/_pagination.scss
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
.pagination {
|
||||||
|
--bs-pagination-bg: var(--bs-primary-bg-subtle);
|
||||||
|
--bs-pagination-border-color: none;
|
||||||
|
--bs-pagination-hover-color: var(--bs-pagination-active-color);
|
||||||
|
--bs-pagination-hover-bg: var(--bs-pagination-active-bg);
|
||||||
|
--bs-pagination-hover-border-color: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination .page-item {
|
||||||
|
margin: 0.4rem;
|
||||||
|
}
|
@@ -27,6 +27,20 @@ defaultContentLanguage = "en"
|
|||||||
defaultContentLanguageInSubdir = true
|
defaultContentLanguageInSubdir = true
|
||||||
# toml-docs-end language
|
# toml-docs-end language
|
||||||
|
|
||||||
|
# toml-docs-start redirect
|
||||||
|
[outputFormats.REDIR]
|
||||||
|
mediaType = "text/netlify"
|
||||||
|
baseName = "_redirects"
|
||||||
|
isPlainText = true
|
||||||
|
notAlternative = true
|
||||||
|
|
||||||
|
[mediaTypes."text/netlify"]
|
||||||
|
delimiter = ""
|
||||||
|
|
||||||
|
[outputs]
|
||||||
|
home = ["HTML", "RSS", "REDIR"]
|
||||||
|
# toml-docs-end redirect
|
||||||
|
|
||||||
# toml-docs-start build
|
# toml-docs-start build
|
||||||
[build]
|
[build]
|
||||||
writeStats = true
|
writeStats = true
|
||||||
@@ -79,6 +93,9 @@ defaultContentLanguageInSubdir = true
|
|||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = "static"
|
source = "static"
|
||||||
target = "static"
|
target = "static"
|
||||||
|
[[module.mounts]]
|
||||||
|
source = "static/fonts"
|
||||||
|
target = "static/fonts"
|
||||||
# toml-docs-start javascript
|
# toml-docs-start javascript
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = "node_modules/bootstrap/dist/js"
|
source = "node_modules/bootstrap/dist/js"
|
||||||
@@ -89,3 +106,6 @@ defaultContentLanguageInSubdir = true
|
|||||||
target = "assets/js/vendor/flexsearch"
|
target = "assets/js/vendor/flexsearch"
|
||||||
includeFiles = "*.bundle.js"
|
includeFiles = "*.bundle.js"
|
||||||
# toml-docs-end javascript
|
# toml-docs-end javascript
|
||||||
|
[[module.mounts]]
|
||||||
|
source = "node_modules/@fortawesome/fontawesome-free/webfonts"
|
||||||
|
target = "static/fonts"
|
||||||
|
@@ -8,10 +8,13 @@
|
|||||||
|
|
||||||
# toml-docs-start docs
|
# toml-docs-start docs
|
||||||
[docs]
|
[docs]
|
||||||
|
latest = "1.0"
|
||||||
version = "0.8"
|
version = "0.8"
|
||||||
basePath = ""
|
basePath = ""
|
||||||
github = "https://github.com/gethinode/hinode"
|
github = "https://github.com/gethinode/hinode"
|
||||||
release = "https://github.com/gethinode/hinode/releases/tag/"
|
release = "https://github.com/gethinode/hinode/releases/tag/"
|
||||||
|
checkVersion = true
|
||||||
|
latestURL = "https://demo.gethinode.com/"
|
||||||
# toml-docs-end docs
|
# toml-docs-end docs
|
||||||
|
|
||||||
# toml-docs-start home
|
# toml-docs-start home
|
||||||
|
16
i18n/en.yaml
16
i18n/en.yaml
@@ -53,14 +53,16 @@
|
|||||||
translation: "Article"
|
translation: "Article"
|
||||||
- id: articles
|
- id: articles
|
||||||
translation: "Articles"
|
translation: "Articles"
|
||||||
|
- id: paginationNav
|
||||||
|
translation: "Page navigation"
|
||||||
- id: paginationPrevious
|
- id: paginationPrevious
|
||||||
translation: "Previous"
|
translation: "Previous page"
|
||||||
- id: paginationNext
|
- id: paginationNext
|
||||||
translation: "Next"
|
translation: "Next page"
|
||||||
- id: paginationFirst
|
- id: paginationFirst
|
||||||
translation: "First"
|
translation: "First page"
|
||||||
- id: paginationLast
|
- id: paginationLast
|
||||||
translation: "Last"
|
translation: "Last page"
|
||||||
- id: toggleSidebar
|
- id: toggleSidebar
|
||||||
translation: "Toggle sidebar navigation"
|
translation: "Toggle sidebar navigation"
|
||||||
- id: colorMode
|
- id: colorMode
|
||||||
@@ -87,6 +89,12 @@
|
|||||||
translation: "Link"
|
translation: "Link"
|
||||||
- id: code
|
- id: code
|
||||||
translation: "Code"
|
translation: "Code"
|
||||||
|
- id: latest
|
||||||
|
translation: "latest"
|
||||||
|
- id: allVersions
|
||||||
|
translation: "All versions"
|
||||||
|
- id: newerVersionAlert
|
||||||
|
translation: "There is a newer version of {{ . }}!"
|
||||||
|
|
||||||
# 404 page
|
# 404 page
|
||||||
- id: pageNotFound
|
- id: pageNotFound
|
||||||
|
@@ -45,6 +45,8 @@
|
|||||||
translation: "Artikel"
|
translation: "Artikel"
|
||||||
- id: articles
|
- id: articles
|
||||||
translation: "Artikelen"
|
translation: "Artikelen"
|
||||||
|
- id: paginationNav
|
||||||
|
translation: "Pagina navigatie"
|
||||||
- id: paginationPrevious
|
- id: paginationPrevious
|
||||||
translation: "Vorige"
|
translation: "Vorige"
|
||||||
- id: paginationNext
|
- id: paginationNext
|
||||||
@@ -77,6 +79,12 @@
|
|||||||
translation: "Link"
|
translation: "Link"
|
||||||
- id: code
|
- id: code
|
||||||
translation: "Code"
|
translation: "Code"
|
||||||
|
- id: latest
|
||||||
|
translation: "meest recente"
|
||||||
|
- id: allVersions
|
||||||
|
translation: "Alle versies"
|
||||||
|
- id: newerVersionAlert
|
||||||
|
translation: "Er is een nieuwere versie van {{ . }}!"
|
||||||
|
|
||||||
# 404 page
|
# 404 page
|
||||||
- id: pageNotFound
|
- id: pageNotFound
|
||||||
|
@@ -1,6 +1,16 @@
|
|||||||
{{- $section := .Section }}
|
{{- $section := .Section }}
|
||||||
{{- with partial "utilities/GetMenu" . }}{{ $.Scratch.Set "sidebar" . }}{{ end -}}
|
{{- $version := partial "utilities/GetVersion.html" (dict "page" . "base" true) -}}
|
||||||
{{ $.Scratch.Set "version" (site.Param (printf "%s.version" .Section)) }}
|
{{- $.Scratch.Set "version" $version -}}
|
||||||
|
{{ with partial "utilities/GetMenu" (dict "page" . "version" $version) }}{{ $.Scratch.Set "sidebar" . }}{{ end }}
|
||||||
|
|
||||||
|
{{- if and site.Params.docs.checkVersion $version -}}
|
||||||
|
{{- if ne $version "latest" -}}
|
||||||
|
{{- if partial "utilities/IsOlder" (dict "current" $version) -}}
|
||||||
|
{{- $.Scratch.Set "pageAlertMsg" (T "newerVersionAlert" site.Title) -}}
|
||||||
|
{{- $.Scratch.Set "pageAlertURL" (or site.Params.docs.latestURL site.baseURL) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="{{ .Site.Language.Lang }}" class="no-js">
|
<html lang="{{ .Site.Language.Lang }}" class="no-js">
|
||||||
|
10
layouts/index.redir
Normal file
10
layouts/index.redir
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{{- range .Site.Params.docs.releases -}}
|
||||||
|
{{- if .redirect -}}
|
||||||
|
{{ urls.JoinPath .url "/*" }} {{ urls.JoinPath .redirect ":splat" }} 200
|
||||||
|
{{ end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{ range $p := .Site.AllPages }}
|
||||||
|
{{- range .Aliases -}}
|
||||||
|
{{ if hasPrefix . "." }}{{ urls.JoinPath $p.RelPermalink . }}{{ else }}{{ . }}{{ end }} {{ $p.RelPermalink }}
|
||||||
|
{{ end }}
|
||||||
|
{{- end -}}
|
@@ -132,7 +132,7 @@
|
|||||||
|
|
||||||
{{ if $paginate }}
|
{{ if $paginate }}
|
||||||
{{- if gt $paginator.TotalPages 1 -}}
|
{{- if gt $paginator.TotalPages 1 -}}
|
||||||
<div class="pt-3">{{ partial "assets/pagination.html" $page }}</div>
|
<div class="pt-3">{{ partial "assets/pagination.html" (dict "page" $page "format" "terse") }}</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ if gt $count $max }}
|
{{ if gt $count $max }}
|
||||||
|
@@ -98,7 +98,7 @@
|
|||||||
{{- $scaled = $img.Fit (printf "%s webp" $dim) -}}
|
{{- $scaled = $img.Fit (printf "%s webp" $dim) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $scaled = $scaled | resources.Copy (replace $img.RelPermalink $clean (printf "-%s.webp" $dim)) -}}
|
{{- $scaled = $scaled | resources.Copy (replace $img.RelPermalink $clean (printf "-%s.webp" $dim)) -}}
|
||||||
{{- $imgset = printf "%s, %s %sw" $imgset $scaled.RelPermalink (index $widths $index) -}}
|
{{- $imgset = printf "%s, %s %sw" $imgset $scaled.Permalink (index $widths $index) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $imgset = strings.TrimPrefix ", " $imgset -}}
|
{{- $imgset = strings.TrimPrefix ", " $imgset -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
srcset="{{ . }}"
|
srcset="{{ . }}"
|
||||||
sizes="100vw"
|
sizes="100vw"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
src="{{ $fallbackURL }}"
|
src="{{ absURL $fallbackURL }}"
|
||||||
alt="{{ $title }}">
|
alt="{{ $title }}">
|
||||||
</div>
|
</div>
|
||||||
{{- if $caption -}}
|
{{- if $caption -}}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
{{- $pageURL := $page.RelPermalink | relLangURL -}}
|
{{- $pageURL := $page.RelPermalink | relLangURL -}}
|
||||||
{{- $isActive := hasPrefix $pageURL $menuURL -}}
|
{{- $isActive := hasPrefix $pageURL $menuURL -}}
|
||||||
{{- $isAlias := $menu.Params.alias -}}
|
{{- $isAlias := $menu.Params.alias -}}
|
||||||
|
{{- $isIcon := $menu.Params.icon -}}
|
||||||
|
|
||||||
{{- $url := urls.Parse $menuURL -}}
|
{{- $url := urls.Parse $menuURL -}}
|
||||||
{{- $baseURL := urls.Parse $.Site.Params.Baseurl -}}
|
{{- $baseURL := urls.Parse $.Site.Params.Baseurl -}}
|
||||||
@@ -36,11 +37,12 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
<a class="{{ $anchorClass }}{{ if $isActive }} active{{ end }}{{ with $class }} {{. }}{{ end }}"
|
<a class="{{ $anchorClass }}{{ if $isActive }} active{{ end }}{{ with $class }} {{. }}{{ end }}"
|
||||||
|
{{ if $isIcon }}aria-label="{{ $menu.Name }}"{{ end }}
|
||||||
data-nav="main" data-nav-main="{{ $mainNav }}"{{ with $childNav }} data-nav-child="{{ . }}"{{ end }}
|
data-nav="main" data-nav-main="{{ $mainNav }}"{{ with $childNav }} data-nav-child="{{ . }}"{{ end }}
|
||||||
href="{{ $menuURL }}{{ $params | safeHTMLAttr }}"{{ with $externalHref }} {{ . | safeHTMLAttr }}{{ end }} {{ $button | safeHTMLAttr }}>
|
href="{{ $menuURL }}{{ $params | safeHTMLAttr }}"{{ with $externalHref }} {{ . | safeHTMLAttr }}{{ end }} {{ $button | safeHTMLAttr }}>
|
||||||
|
|
||||||
{{- with $menu.Pre }}{{ . }}{{ end -}}
|
{{- with $menu.Pre }}{{ . }}{{ end -}}
|
||||||
<span {{ if $isActive }} class="active"{{ end }}>{{ $menu.Name }}</span>
|
<span {{ if $isActive }} class="active"{{ end }}>{{ if not $isIcon }}{{ $menu.Name }}{{ end }}</span>
|
||||||
{{- with $menu.Post }}{{ . }}{{ end -}}
|
{{- with $menu.Post }}{{ . }}{{ end -}}
|
||||||
{{- if $isExternal }} {{ partial "assets/icon.html" (dict "icon" "fas up-right-from-square fa-2xs") }}{{ end -}}
|
{{- if and $isExternal (not $isIcon)}} {{ partial "assets/icon.html" (dict "icon" "fas up-right-from-square fa-2xs") }}{{ end -}}
|
||||||
</a>
|
</a>
|
||||||
|
@@ -48,6 +48,51 @@
|
|||||||
</li>
|
</li>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
<!-- Inline partial to render the version switcher -->
|
||||||
|
{{- define "partials/navbar-versions.html" -}}
|
||||||
|
{{- $size := .size -}}
|
||||||
|
{{- $collapsed := .collapsed -}}
|
||||||
|
{{- $page := .page -}}
|
||||||
|
{{- $list := site.Params.docs.releases -}}
|
||||||
|
{{- $version := partial "utilities/GetVersion.html" (dict "page" $page) -}}
|
||||||
|
|
||||||
|
<li class="nav-item dropdown {{ if $collapsed }}d-{{ $size }}-none{{ else }}d-none d-{{ $size }}-block{{ end }}">
|
||||||
|
<a class="nav-link dropdown-toggle" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false" id="navbar-version-switch">
|
||||||
|
{{ if $collapsed }}{{ site.Title }} {{ end }}{{ $version }}
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbar-version-switch">
|
||||||
|
{{- range $index, $item := $list -}}
|
||||||
|
{{- $active := eq $item.label $version -}}
|
||||||
|
{{- $disabled := false -}}
|
||||||
|
{{- if site.IsServer }}
|
||||||
|
{{- $disabled = and $item.redirect (gt (len $item.redirect) 0) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ if $item.url }}
|
||||||
|
<li>
|
||||||
|
{{- $url := (path.Join $item.url) | relLangURL -}}
|
||||||
|
<a class="pe-5 dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}{{ if $active }} active{{ end }}{{ if $disabled }} disabled{{ end }}" href="{{ $url }}">{{ $item.label }}
|
||||||
|
{{ if $item.latest }} ({{ T "latest" }}){{ end }}
|
||||||
|
{{ if $active }}
|
||||||
|
<span class="position-absolute end-0 me-3">{{- partial "assets/icon.html" (dict "icon" "fas check") }}</span>
|
||||||
|
{{ end }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{ else }}
|
||||||
|
{{ if gt $index 0}}<li><hr class="dropdown-divider"></li>{{ end }}
|
||||||
|
<li><span class="dropdown-header fs-6">{{ $item.label }}</span></li>
|
||||||
|
{{ end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if site.Params.docs.overview -}}
|
||||||
|
{{ if gt (len $list) 0 }}<li><hr class="dropdown-divider"></li>{{ end }}
|
||||||
|
<li>
|
||||||
|
{{- $url := (path.Join site.Params.docs.overview) | relLangURL -}}
|
||||||
|
<a class="dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}" href="{{ $url }}">{{ T "allVersions" }}</a>
|
||||||
|
</li>
|
||||||
|
{{- end -}}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- $supportedFlags := slice "true" "false" -}}
|
{{- $supportedFlags := slice "true" "false" -}}
|
||||||
|
|
||||||
{{- $id := printf "navbar-collapse-%d" 0 -}}
|
{{- $id := printf "navbar-collapse-%d" 0 -}}
|
||||||
@@ -112,6 +157,12 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $enableVersions := false -}}
|
||||||
|
{{ $list := site.Params.docs.releases }}
|
||||||
|
{{ if $list }}
|
||||||
|
{{- $enableVersions = gt (len $list ) 1 -}}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{- $enableLanguage := or $page.IsTranslated site.IsMultiLingual -}}
|
{{- $enableLanguage := or $page.IsTranslated site.IsMultiLingual -}}
|
||||||
|
|
||||||
{{- $logo := site.Params.navigation.logo -}}
|
{{- $logo := site.Params.navigation.logo -}}
|
||||||
@@ -130,98 +181,113 @@
|
|||||||
{{- if eq $color "black" }}{{ $theme = "dark" }}{{ end -}}
|
{{- if eq $color "black" }}{{ $theme = "dark" }}{{ end -}}
|
||||||
{{- if eq $color "white" }}{{ $theme = "light" }}{{ end -}}
|
{{- if eq $color "white" }}{{ $theme = "light" }}{{ end -}}
|
||||||
|
|
||||||
<nav class="navbar navbar-expand-{{ $size }} {{ with $color }}bg-{{ . }}{{ end }} {{ if $fixed }}fixed-top{{ end }} p-4"{{ with $theme }} data-bs-theme="{{ . }}"{{ end }}>
|
<div class="container-fluid {{ if $fixed }}fixed-top{{ end }} p-0"{{ with $theme }} data-bs-theme="{{ . }}"{{ end }}>
|
||||||
<div class="container-xxl p-0">
|
{{- partial "assets/page-alert.html" (dict "page" $page) -}}
|
||||||
<!-- Insert sidebar toggler when applicable -->
|
<nav class="navbar navbar-expand-{{ $size }} {{ with $color }}bg-{{ . }}{{ end }} p-4"{{ with $theme }} data-bs-theme="{{ . }}"{{ end }}>
|
||||||
<div class="d-flex">
|
<div class="container-xxl p-0">
|
||||||
{{- if $page.Scratch.Get "sidebar" -}}
|
<!-- Insert sidebar toggler when applicable -->
|
||||||
<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" }}">
|
<div class="d-flex">
|
||||||
{{- partial "assets/icon.html" (dict "icon" "fas ellipsis") -}}
|
{{- if $page.Scratch.Get "sidebar" -}}
|
||||||
|
<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 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 }}">
|
||||||
|
{{- if $logo -}}
|
||||||
|
<img src="{{ $logo }}" alt="{{ $title }} logo" height="30">
|
||||||
|
{{- else -}}
|
||||||
|
<span class="fw-bold">{{ $title }}</span>
|
||||||
|
{{- end -}}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Insert main navigation toggler -->
|
||||||
|
<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="#{{ $id }}"
|
||||||
|
aria-controls="{{ $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>
|
</button>
|
||||||
{{- else -}}
|
</div>
|
||||||
<!-- Insert invisible sidebar toggler to center logo correctly on smaller screens -->
|
|
||||||
<button class="navbar-toggler fw-30 collapsed p-0 mx-auto invisible" type="button">
|
<div class="navbar-collapse collapse" id="{{ $id }}">
|
||||||
{{- partial "assets/icon.html" (dict "icon" "fas ellipsis") -}}
|
<!-- Insert search input -->
|
||||||
</button>
|
{{- if $search }}{{ partial "assets/search-input.html" -}}{{ end -}}
|
||||||
{{- end -}}
|
|
||||||
</div>
|
<!-- Render top-menu items (maximum depth of 2) -->
|
||||||
|
<ul class="navbar-nav ms-auto">
|
||||||
<!-- Insert the brand logo or name -->
|
{{- range $menu := $menus -}}
|
||||||
<a class="navbar-brand mx-auto" href="{{ site.Home.RelPermalink }}">
|
<li class="nav-item{{ if .HasChildren }} dropdown{{ end }}">
|
||||||
{{- if $logo -}}
|
{{- partial "assets/navbar-item.html" (dict "menu" $menu "page" $page) -}}
|
||||||
<img src="{{ $logo }}" alt="{{ $title }} logo" height="30">
|
{{- if .HasChildren -}}
|
||||||
{{- else -}}
|
<ul class="dropdown-menu dropdown-menu-end">
|
||||||
<span class="fw-bold">{{ $title }}</span>
|
{{- range .Children -}}
|
||||||
{{- end -}}
|
{{- partial "assets/navbar-item.html" (dict "menu" . "parent" $menu "page" $page) -}}
|
||||||
</a>
|
{{- end -}}
|
||||||
|
</ul>
|
||||||
<!-- Insert main navigation toggler -->
|
{{- end -}}
|
||||||
<div class="d-flex fw-30">
|
</li>
|
||||||
<button id="main-nav-toggler" class="navbar-toggler collapsed p-0" type="button" data-bs-toggle="collapse" data-bs-target="#{{ $id }}"
|
{{- end -}}
|
||||||
aria-controls="{{ $id }}" aria-expanded="false" aria-label="{{ T "toggleMainNav" }}">
|
|
||||||
<span class="toggler-icon top-bar emphasis"></span>
|
<!-- Insert divider if applicable -->
|
||||||
<span class="toggler-icon middle-bar emphasis"></span>
|
{{- if or $enableLanguage $enableVersions -}}
|
||||||
<span class="toggler-icon bottom-bar emphasis"></span>
|
<li class="nav-item py-2 py-md-1 col-12 col-md-auto d-none d-{{ $size }}-block">
|
||||||
</button>
|
<div class="vr d-none d-md-flex h-100 mx-md-2"></div>
|
||||||
</div>
|
</li>
|
||||||
|
<li><hr class="dropdown-divider-bg"></li>
|
||||||
<div class="navbar-collapse collapse" id="{{ $id }}">
|
{{- end -}}
|
||||||
<!-- Insert search input -->
|
|
||||||
{{- if $search }}{{ partial "assets/search-input.html" -}}{{ end -}}
|
<!-- Insert language switcher if applicable -->
|
||||||
|
{{- if $enableLanguage -}}
|
||||||
<!-- Render top-menu items (maximum depth of 2) -->
|
{{- $currentLang := $page.Language.Lang -}}
|
||||||
<ul class="navbar-nav ms-auto">
|
<li class="nav-item dropdown">
|
||||||
{{- range $menu := $menus -}}
|
<a class="nav-link dropdown-toggle d-{{ $size }}-none" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
<li class="nav-item{{ if .HasChildren }} dropdown{{ end }}">
|
{{- partial "assets/icon.html" (dict "icon" "fas globe") }} {{ T "languageSwitcherLabel" }}
|
||||||
{{- partial "assets/navbar-item.html" (dict "menu" $menu "page" $page) -}}
|
</a>
|
||||||
{{- if .HasChildren -}}
|
<a class="nav-link dropdown-toggle d-none d-{{ $size }}-block" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
<ul class="dropdown-menu dropdown-menu-end">
|
{{- partial "assets/icon.html" (dict "icon" "fas globe") }}
|
||||||
{{- range .Children -}}
|
</a>
|
||||||
{{- partial "assets/navbar-item.html" (dict "menu" . "parent" $menu "page" $page) -}}
|
<ul class="dropdown-menu dropdown-menu-end ">
|
||||||
|
{{- if $page.IsTranslated -}}
|
||||||
|
{{- range $page.AllTranslations -}}
|
||||||
|
<li><a class="dropdown-item {{ if eq .Language.Lang $currentLang }}active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- range site.Languages -}}
|
||||||
|
<li><a class="dropdown-item" href="/{{ .Lang }}">{{ default .Lang .LanguageName }}</a></li>
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</ul>
|
</ul>
|
||||||
{{- end -}}
|
</li>
|
||||||
</li>
|
{{- end -}}
|
||||||
{{- end -}}
|
|
||||||
|
<!-- Insert version switcher -->
|
||||||
<!-- Insert divider if applicable -->
|
{{- if $enableVersions -}}
|
||||||
{{- if or $enableLanguage $enableDarkMode -}}
|
{{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" true ) -}}
|
||||||
<li class="nav-item py-2 py-md-1 col-12 col-md-auto d-none d-{{ $size }}-block">
|
{{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" false) -}}
|
||||||
<div class="vr d-none d-md-flex h-100 mx-md-2"></div>
|
{{- end -}}
|
||||||
</li>
|
|
||||||
<li><hr class="dropdown-divider-bg"></li>
|
<!-- Insert color mode switcher -->
|
||||||
{{- end -}}
|
{{- if $enableDarkMode -}}
|
||||||
|
<!-- Insert divider -->
|
||||||
<!-- Insert language switcher if applicable -->
|
<li class="nav-item py-2 py-md-1 col-12 col-md-auto d-none d-{{ $size }}-block">
|
||||||
{{- if $enableLanguage -}}
|
<div class="vr d-none d-md-flex h-100 mx-md-2"></div>
|
||||||
{{- $currentLang := $page.Language.Lang -}}
|
</li>
|
||||||
<li class="nav-item dropdown">
|
<li><hr class="dropdown-divider-bg"></li>
|
||||||
<a class="nav-link dropdown-toggle d-{{ $size }}-none" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
||||||
{{- partial "assets/icon.html" (dict "icon" "fas globe") }} {{ T "languageSwitcherLabel" }}
|
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" true) -}}
|
||||||
</a>
|
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" false) -}}
|
||||||
<a class="nav-link dropdown-toggle d-none d-{{ $size }}-block" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
{{- end -}}
|
||||||
{{- partial "assets/icon.html" (dict "icon" "fas globe") }}
|
</ul>
|
||||||
</a>
|
</div>
|
||||||
<ul class="dropdown-menu dropdown-menu-end ">
|
|
||||||
{{- if $page.IsTranslated -}}
|
|
||||||
{{- range $page.AllTranslations -}}
|
|
||||||
<li><a class="dropdown-item {{ if eq .Language.Lang $currentLang }}active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
|
||||||
{{- end -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- range site.Languages -}}
|
|
||||||
<li><a class="dropdown-item" href="/{{ .Lang }}">{{ default .Lang .LanguageName }}</a></li>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
<!-- Insert color mode switcher -->
|
|
||||||
{{- if $enableDarkMode -}}
|
|
||||||
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" true) -}}
|
|
||||||
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" false) -}}
|
|
||||||
{{- end -}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</nav>
|
||||||
</nav>
|
</div>
|
||||||
|
15
layouts/partials/assets/page-alert.html
Normal file
15
layouts/partials/assets/page-alert.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{{- $page := .page -}}
|
||||||
|
{{- if not $page -}}
|
||||||
|
{{- errorf "partial [assets/page-alert.html] - Missing value for param 'page'" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $pageAlertMsg := $page.Scratch.Get "pageAlertMsg" -}}
|
||||||
|
{{- $pageAlertURL := $page.Scratch.Get "pageAlertURL" -}}
|
||||||
|
{{- $version := $page.Scratch.Get "version" -}}
|
||||||
|
|
||||||
|
{{- if $pageAlertMsg -}}
|
||||||
|
<div id="page-alert" class="alert alert-primary alert-no-decoration fade show d-flex align-items-center small m-0 py-1" data-page-alert-version="{{ $version }}">
|
||||||
|
<a href="{{ with $pageAlertURL }}{{ . }}{{ else }}#!{{ end }}" class="text-decoration-none flex-grow-1 text-center">{{ $pageAlertMsg }}</a>
|
||||||
|
<button id="page-alert-btn-close" type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
@@ -22,9 +22,11 @@
|
|||||||
|
|
||||||
{{- if in $validFormats $format }}
|
{{- if in $validFormats $format }}
|
||||||
{{- if gt $page.Paginator.TotalPages 1 }}
|
{{- if gt $page.Paginator.TotalPages 1 }}
|
||||||
<ul class="pagination pagination-{{ $format }} justify-content-center">
|
<nav aria-label="{{ T "paginationNav" }}">
|
||||||
{{- partial (printf "partials/inline/pagination/%s" $format) $page }}
|
<ul class="pagination pagination-{{ $format }} justify-content-center">
|
||||||
</ul>
|
{{- partial (printf "partials/inline/pagination/%s" $format) $page }}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- errorf $msg2 (delimit $validFormats ", ") }}
|
{{- errorf $msg2 (delimit $validFormats ", ") }}
|
||||||
@@ -50,11 +52,11 @@
|
|||||||
|
|
||||||
{{- with .Prev }}
|
{{- with .Prev }}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationPrevious" }}</span></a>
|
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-left"></i></span></a>
|
||||||
</li>
|
</li>
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled">
|
||||||
<a aria-disabled="true" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ T "paginationPrevious" }}</span></a>
|
<a aria-disabled="true" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true"><i class="fas fa-angle-left"></i></span></a>
|
||||||
</li>
|
</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
@@ -79,11 +81,11 @@
|
|||||||
|
|
||||||
{{- with .Next }}
|
{{- with .Next }}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationNext" }}</span></a>
|
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-right"></i></span></a>
|
||||||
</li>
|
</li>
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled">
|
||||||
<a aria-disabled="true" aria-label="{{ T "paginationNext" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ T "paginationNext" }}</span></a>
|
<a aria-disabled="true" aria-label="{{ T "paginationNext" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true"><i class="fas fa-angle-right"></i></span></a>
|
||||||
</li>
|
</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
@@ -110,14 +112,14 @@
|
|||||||
{{- with .First }}
|
{{- with .First }}
|
||||||
{{- if ne $currentPageNumber .PageNumber }}
|
{{- if ne $currentPageNumber .PageNumber }}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationFirst" }}</span></a>
|
<a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-double-left"></i></span></a>
|
||||||
</li>
|
</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- with .Prev }}
|
{{- with .Prev }}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationPrevious" }}</span></a>
|
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-left"></i></span></a>
|
||||||
</li>
|
</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
@@ -142,7 +144,7 @@
|
|||||||
|
|
||||||
{{- with .Next }}
|
{{- with .Next }}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationNext" }}</span></a>
|
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-right"></i></span></a>
|
||||||
</li>
|
</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
@@ -20,9 +20,9 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if not hugo.IsProduction -}}
|
{{- if not hugo.IsProduction -}}
|
||||||
<script src="{{ $js.RelPermalink }}"></script>
|
<script src="{{ $js.Permalink }}"></script>
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
{{ $js = $js | minify | fingerprint -}}
|
{{ $js = $js | minify | fingerprint -}}
|
||||||
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
|
<script src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
@@ -1,6 +1,12 @@
|
|||||||
|
{{- $page := .page -}}
|
||||||
|
{{- $version := .version -}}
|
||||||
|
|
||||||
{{- $menu := "" -}}
|
{{- $menu := "" -}}
|
||||||
{{- if .IsPage -}}
|
{{- if $page.IsPage -}}
|
||||||
{{- $menu = index .Site.Data .Section -}}
|
{{- $menu = index site.Data (printf "%s-%s" $page.Section $version) -}}
|
||||||
|
{{ if not $menu }}
|
||||||
|
{{ $menu = index site.Data $page.Section }}
|
||||||
|
{{ end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- return $menu -}}
|
{{- return $menu -}}
|
34
layouts/partials/utilities/GetVersion.html
Normal file
34
layouts/partials/utilities/GetVersion.html
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<!--
|
||||||
|
Retrieve the docs version label of the current page. The path of the page's file is matched with the url of the
|
||||||
|
defined docs releases in the site's parameters. When no match is found it returns the latest label instead.
|
||||||
|
-->
|
||||||
|
|
||||||
|
{{- $page := .page -}}
|
||||||
|
{{- $base := .base -}}
|
||||||
|
{{- $version := "" -}}
|
||||||
|
|
||||||
|
{{- $docsPath := strings.TrimPrefix "/" site.Params.docs.contentPath -}}
|
||||||
|
{{- if and $page.File (strings.HasPrefix $page.File.Dir $docsPath) -}}
|
||||||
|
{{- $currentPath := strings.TrimPrefix $docsPath $page.File.Dir -}}
|
||||||
|
{{- $currentVersion := index (split $currentPath "/") 0 -}}
|
||||||
|
{{- $versionPath := path.Join site.Params.docs.contentPath $currentVersion -}}
|
||||||
|
|
||||||
|
{{- $list := site.Params.docs.releases -}}
|
||||||
|
{{- range $index, $item := $list -}}
|
||||||
|
{{- $url := strings.TrimSuffix "/" $item.url -}}
|
||||||
|
{{- if eq $url $versionPath -}}
|
||||||
|
{{- if $base }}{{ $version = path.Base $item.url }}{{ else }}{{ $version = $item.label }}{{ end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not $version -}}
|
||||||
|
{{- $list := site.Params.docs.releases -}}
|
||||||
|
{{- range $item := $list -}}
|
||||||
|
{{- if $item.latest -}}
|
||||||
|
{{- if $base }}{{ $version = path.Base $item.url }}{{ else }}{{ $version = $item.label }}{{ end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- return $version -}}
|
32
layouts/partials/utilities/IsOlder.html
Normal file
32
layouts/partials/utilities/IsOlder.html
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<!--
|
||||||
|
Returns true if the current version is older than the latest version defined in the docs section of the site
|
||||||
|
parameters. The verification supports semver patterns MAJOR.MINOR.PATCH with an optional suffix.
|
||||||
|
|
||||||
|
Original code by solus on https://discourse.gohugo.io/t/sorting-semantic-version-numbers/40838/6.
|
||||||
|
-->
|
||||||
|
|
||||||
|
{{ $current := .current }}
|
||||||
|
{{ $latest := site.Params.docs.latest }}
|
||||||
|
|
||||||
|
{{- define "partials/padZeroPrefix.html" -}}
|
||||||
|
{{- $padSize := 6 }}
|
||||||
|
{{- $paddedString := replaceRE "(\\d+)" (print (strings.Repeat (sub $padSize 1) "0") "$1") . }}
|
||||||
|
{{- $trimmedString := replaceRE (print "0+(\\d{" $padSize "})") "$1" $paddedString }}
|
||||||
|
{{- return $trimmedString }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "partials/trimZeroPrefix.html" -}}
|
||||||
|
{{- return replaceRE "0+(\\d+)" "$1" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $isOlder := false -}}
|
||||||
|
|
||||||
|
{{- if and $current $latest }}
|
||||||
|
{{- $versions := slice $current $latest }}
|
||||||
|
{{- $paddedVersions := apply $versions "partial" "padZeroPrefix" "." }}
|
||||||
|
{{- $sortedVersions := (sort $paddedVersions "value" "desc") }}
|
||||||
|
{{- $sortedVersions = apply $sortedVersions "partial" "trimZeroPrefix" "." }}
|
||||||
|
{{ $isOlder = ne (index $sortedVersions 0) $current }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- return $isOlder -}}
|
2613
package-lock.json
generated
2613
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gethinode/hinode",
|
"name": "@gethinode/hinode",
|
||||||
"version": "0.14.5",
|
"version": "0.15.0-beta5",
|
||||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"hugo",
|
"hugo",
|
||||||
@@ -34,7 +34,6 @@
|
|||||||
"env": "hugo env",
|
"env": "hugo env",
|
||||||
"precheck": "npm version",
|
"precheck": "npm version",
|
||||||
"check": "hugo version",
|
"check": "hugo version",
|
||||||
"copy:fonts": "shx cp ./node_modules/@fortawesome/fontawesome-free/webfonts/* ./static/fonts/",
|
|
||||||
"create:syntax-light": "hugo gen chromastyles --style=github > ./assets/scss/components/_syntax-light.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-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",
|
"create:syntax": "npm run -s create:syntax-light & npm run -s create:syntax-dark",
|
||||||
@@ -60,11 +59,11 @@
|
|||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-config-standard": "^17.0.0",
|
"eslint-config-standard": "^17.0.0",
|
||||||
"eslint-plugin-import": "^2.27.5",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-n": "^15.7.0",
|
"eslint-plugin-n": "^16.0.0",
|
||||||
"eslint-plugin-promise": "^6.1.1",
|
"eslint-plugin-promise": "^6.1.1",
|
||||||
"flexsearch": "^0.7.31",
|
"flexsearch": "^0.7.31",
|
||||||
"hugo-bin": "^0.103.0",
|
"hugo-bin": "^0.108.0",
|
||||||
"markdownlint-cli2": "^0.7.0",
|
"markdownlint-cli2": "^0.8.1",
|
||||||
"postcss-cli": "^10.1.0",
|
"postcss-cli": "^10.1.0",
|
||||||
"purgecss-whitelister": "^2.4.0",
|
"purgecss-whitelister": "^2.4.0",
|
||||||
"rimraf": "^5.0.0",
|
"rimraf": "^5.0.0",
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user