Compare commits

...

18 Commits

Author SHA1 Message Date
Mark Dumay
dac09afbba Merge pull request #1348 from gethinode/develop
Update minimum required Hugo version
2025-01-03 06:56:56 +01:00
Mark Dumay
a35e59df3d Merge branch 'main' into develop 2025-01-03 06:47:05 +01:00
Mark Dumay
51b80d8820 Update minimum required Hugo version
Depends on [TrimSpace]( https://gohugo.io/functions/strings/trimspace/)
2025-01-03 06:45:51 +01:00
Mark Dumay
28c12e61e9 Merge pull request #1346 from gethinode/develop
Fix rendering of Hinode version in meta tags
2025-01-02 16:52:53 +01:00
Mark Dumay
c2d4782375 Merge branch 'main' into develop 2025-01-02 16:46:12 +01:00
Mark Dumay
4aa5723235 Fix rendering of Hinode version in meta tags 2025-01-02 16:45:49 +01:00
Mark Dumay
6d602df62d Merge pull request #1345 from gethinode/develop
Prevent switching to unavailable translation
2025-01-02 07:38:07 +01:00
Mark Dumay
336f32b4a4 Merge branch 'main' into develop 2025-01-02 07:28:53 +01:00
Mark Dumay
1792ee527d Prevent switching to unavailable translation 2025-01-02 07:28:25 +01:00
Mark Dumay
d750dcfb5a Merge pull request #1344 from gethinode/develop
Sync French card group example with English version
2025-01-02 07:27:32 +01:00
Mark Dumay
448ebdbaad Merge branch 'main' into develop 2025-01-02 07:21:50 +01:00
Mark Dumay
7b8152d84e Sync French card group example with English version 2025-01-02 07:20:37 +01:00
Mark Dumay
df00db0447 Merge pull request #1342 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2025-01-02 07:00:16 +01:00
Mark Dumay
658a02798e Merge branch 'main' into hugo-mod-dependencies 2025-01-02 06:46:24 +01:00
Mark Dumay
7329fdf3f9 Merge pull request #1343 from gethinode/develop
Fix handling of pagination
2025-01-02 06:46:12 +01:00
Mark Dumay
34550a3e00 Merge branch 'main' into develop 2025-01-02 06:32:46 +01:00
Mark Dumay
b88b17642d Fix handling of pagination 2025-01-02 06:30:46 +01:00
markdumay
ecb06164e0 fix: update Hugo module dependencies 2025-01-02 03:09:03 +00:00
15 changed files with 89 additions and 32 deletions

View File

@@ -25,7 +25,10 @@
window.location.href = href
}
} else {
window.location.href = folder + language + '/'
let target = folder + language + '/'
if (window.location.href !== target) {
window.location.href = target
}
}
}
}
@@ -42,7 +45,7 @@
// continue with regular code
const storedLanguage = getLanguage()
const languageItems = document.querySelectorAll('#language-selector .dropdown-item')
const languageItems = document.querySelectorAll('#language-selector[data-translated=true] .dropdown-item')
const link = document.querySelector("link[rel='canonical']")
let alias = ''
@@ -50,7 +53,7 @@
alias = link.getAttribute('href')
}
if (alias !== '') {
if ((alias !== '') && (window.location.href !== alias)) {
window.location.href = alias
} else if (languageItems.length > 0) {
// Redirect if the stored language differs from the active language
@@ -74,10 +77,8 @@
})
}
else {
// Redirect to the localized homepage
const defaultLang = '{{ site.LanguageCode | default site.Language.Lang }}'
let language = storedLanguage ? storedLanguage : defaultLang
window.location.href = folder + language + '/'
// overrule the current stored language when no translation is available
setLanguage(document.documentElement.lang)
}
})
})()

View File

@@ -116,8 +116,7 @@ home = ["HTML", "RSS", "REDIR", "netlify", "server"]
[module]
[module.hugoVersion]
extended = true
min = "0.134.0"
max = ""
min = "0.136.3"
[[module.mounts]]
source = "archetypes"
target = "archetypes"
@@ -139,6 +138,11 @@ home = ["HTML", "RSS", "REDIR", "netlify", "server"]
[[module.mounts]]
source = "static"
target = "static"
# ensures main package.json is always available, even when using workspaces
# in workspaces, the package.json is pointing to the first imported module
[[module.mounts]]
source = "package.json"
target = "assets/data/package-hinode.json"
[[module.mounts]]
source = "netlify.toml"
target = "assets/config/netlify.toml"

View File

@@ -136,7 +136,7 @@ En-tête 6 {{</* badge title="Nouveau" */>}}
{{% comment %}}<!-- markdownlint-disable MD037 -->{{% /comment %}}
{{< example lang="hugo" >}}
{{</* card-group padding="3" gutter="3" */>}}
{{</* card-group padding="3" gutter="3" button=true buttonType="link" cols=2 scroll=true */>}}
{{</* card title="Framework Bootstrap" icon="fab bootstrap" */>}}
Créez des sites rapides et réactifs avec Bootstrap 5. Personnalisez facilement votre site
avec les fichiers source Sass.

View File

@@ -3,5 +3,5 @@ module github.com/gethinode/hinode/exampleSite
go 1.19
require (
github.com/gethinode/mod-cookieyes/v2 v2.2.2 // indirect
github.com/gethinode/mod-cookieyes/v2 v2.2.3 // indirect
)

View File

@@ -1,2 +1,2 @@
github.com/gethinode/mod-cookieyes/v2 v2.2.2 h1:VNIdbZnzXw/0Jito/IcDNqQ9yRYLCGrDwyrMqtSJgE4=
github.com/gethinode/mod-cookieyes/v2 v2.2.2/go.mod h1:tULb7D7CoTycGUyL7ryqHJKaX11XuL2SN+XwP7/DI0Y=
github.com/gethinode/mod-cookieyes/v2 v2.2.3 h1:l7aSymSZ/FKYBQFCKXDUN1UiTJX+yvuyB8bmh4fPrG0=
github.com/gethinode/mod-cookieyes/v2 v2.2.3/go.mod h1:tULb7D7CoTycGUyL7ryqHJKaX11XuL2SN+XwP7/DI0Y=

8
go.mod
View File

@@ -5,14 +5,14 @@ go 1.19
require (
github.com/airbnb/lottie-web v5.12.2+incompatible // indirect
github.com/gethinode/mod-bootstrap v1.3.1 // indirect
github.com/gethinode/mod-csp v1.0.5 // indirect
github.com/gethinode/mod-csp v1.0.6 // indirect
github.com/gethinode/mod-flexsearch/v2 v2.0.2 // indirect
github.com/gethinode/mod-fontawesome v1.10.0 // indirect
github.com/gethinode/mod-google-analytics v1.1.5 // indirect
github.com/gethinode/mod-google-analytics v1.1.6 // indirect
github.com/gethinode/mod-katex v1.1.2 // indirect
github.com/gethinode/mod-leaflet v1.2.0 // indirect
github.com/gethinode/mod-lottie v1.5.12 // indirect
github.com/gethinode/mod-simple-datatables v1.1.4 // indirect
github.com/gethinode/mod-lottie v1.5.13 // indirect
github.com/gethinode/mod-simple-datatables v1.1.5 // indirect
github.com/gethinode/mod-utils/v2 v2.8.4 // indirect
github.com/nextapps-de/flexsearch v0.0.0-20240501124520-961c3ae84a87 // indirect
github.com/twbs/bootstrap v5.3.3+incompatible // indirect

8
go.sum
View File

@@ -36,6 +36,8 @@ github.com/gethinode/mod-csp v1.0.4 h1:ChI+DMkkkCF5tKs+K9VSqdsXPS01/QANQiJ2LoJp1
github.com/gethinode/mod-csp v1.0.4/go.mod h1:Nb22QMicoUHgZQUKP5TCgVrSI8K3KU7jLuLBShmotjg=
github.com/gethinode/mod-csp v1.0.5 h1:Ypdzw26iQ9/4sAgHvwFY1mg/EMoLrcI2knvVmHq2Ffs=
github.com/gethinode/mod-csp v1.0.5/go.mod h1:Nb22QMicoUHgZQUKP5TCgVrSI8K3KU7jLuLBShmotjg=
github.com/gethinode/mod-csp v1.0.6 h1:ufEKQldQe9ZCXbENTpwqVlYnPRgVv3WDhPjur5OLUEA=
github.com/gethinode/mod-csp v1.0.6/go.mod h1:Nb22QMicoUHgZQUKP5TCgVrSI8K3KU7jLuLBShmotjg=
github.com/gethinode/mod-flexsearch v1.0.1 h1:FJkRsUzSnQTXl3MWCigT4E6vfff870UWTnkGqaDGIhA=
github.com/gethinode/mod-flexsearch v1.0.1/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-flexsearch v1.1.0 h1:7BCMyQDlYlskNXuazt8Jg/jg9WREexu2xVkYqThkAX4=
@@ -150,6 +152,8 @@ github.com/gethinode/mod-google-analytics v1.1.4 h1:GkLzbSdVIMLWSQ4VOSaJZIKyofmV
github.com/gethinode/mod-google-analytics v1.1.4/go.mod h1:dl628cFozpCvoIMCiV7ujzQipjxcm3eatXrSfLPWNII=
github.com/gethinode/mod-google-analytics v1.1.5 h1:wlOcgwNEJAnIQmPJIo3cT06xnr1dxN/ydUIztoC/7rM=
github.com/gethinode/mod-google-analytics v1.1.5/go.mod h1:dl628cFozpCvoIMCiV7ujzQipjxcm3eatXrSfLPWNII=
github.com/gethinode/mod-google-analytics v1.1.6 h1:0eNIM4NTzXnnRHMM04IVnYPPGwbMAmit6fjuUuCQv2I=
github.com/gethinode/mod-google-analytics v1.1.6/go.mod h1:dl628cFozpCvoIMCiV7ujzQipjxcm3eatXrSfLPWNII=
github.com/gethinode/mod-katex v1.0.0 h1:me/3dIIZBkfk1mRIFt8QiAGYwYDoSG5bc2hHRtIutFc=
github.com/gethinode/mod-katex v1.0.0/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
github.com/gethinode/mod-katex v1.0.1 h1:809QUztxmKgMNchU+v03iMO7Ma+ISc3ZzhXYauc21rs=
@@ -248,6 +252,8 @@ github.com/gethinode/mod-lottie v1.5.11 h1:xhxBPDS0iyUY+C1ANaD5EeQV7fO1FG0wMoCjg
github.com/gethinode/mod-lottie v1.5.11/go.mod h1:6FKqk8c+Jkbk2udCxUKVLF1K1wrGwthPsOvRzeoPXRQ=
github.com/gethinode/mod-lottie v1.5.12 h1:ny+5DfxWpgRPszhrSUqg+BcNt05ai1OvPAEgCuioFnA=
github.com/gethinode/mod-lottie v1.5.12/go.mod h1:0WZP8x7duK/AIZ8fWdZNRnteG03kYfLtsaph7z1mdOg=
github.com/gethinode/mod-lottie v1.5.13 h1:Vth/OZDjfBZ9Kz5ew3tXGj9tU6w4StIta6qgfa1daZo=
github.com/gethinode/mod-lottie v1.5.13/go.mod h1:tMFSUW9z3kC8IvDfs1ph9MGjuZFRBrpCnpodrwY+L4w=
github.com/gethinode/mod-simple-datatables v1.0.0 h1:Dj4WGw12OkaimwkCpLn5Jhmd49dvNJW9O2P/W9F+HlQ=
github.com/gethinode/mod-simple-datatables v1.0.0/go.mod h1:K8T7fIdb8pMOB+OSW4A5lz5IW99+HyzcTgx764fvOGw=
github.com/gethinode/mod-simple-datatables v1.0.2 h1:zhqxHet3iLQWYCBbGROALpOY9zQlptMycFkz1Tto5bA=
@@ -280,6 +286,8 @@ github.com/gethinode/mod-simple-datatables v1.1.3 h1:a+uIfgc6c+9Zc38Q+Kzd3cWeFhC
github.com/gethinode/mod-simple-datatables v1.1.3/go.mod h1:8q/6f3uAPNTTP5NjEJOuXr6tEWelRFLJfzVJ3AODMlQ=
github.com/gethinode/mod-simple-datatables v1.1.4 h1:8+uwaEBoh8N2T2sHlcIcxqAGaHPqT0YhPBmr2SFWBCY=
github.com/gethinode/mod-simple-datatables v1.1.4/go.mod h1:8q/6f3uAPNTTP5NjEJOuXr6tEWelRFLJfzVJ3AODMlQ=
github.com/gethinode/mod-simple-datatables v1.1.5 h1:DKJ+aR94mekzcDwOnm6MJ/+MjAzal+GSYQXSdn0HRdc=
github.com/gethinode/mod-simple-datatables v1.1.5/go.mod h1:bvMdmQFk4Hvyltf/QhMqUaApvPbIGTnbI3JLjOEh8go=
github.com/gethinode/mod-utils v1.0.0 h1:cqHm2xS5uDiJzRm1KfHaNbq6uMVDKLhQa8/BuTZ1nhY=
github.com/gethinode/mod-utils v1.0.0/go.mod h1:ONJm3pHCq7nvaPNjusLZNCeCbhOhSBH4HVKHwK1FdYE=
github.com/gethinode/mod-utils v1.0.1 h1:jhZGlGFHHL1f5HXbBMXfiZ2gCz4TVafAzjnRPTIBSEE=

View File

@@ -67,6 +67,8 @@
{{ $paginator = $args.page.Paginate $list }}
{{ end }}
{{ $list = first $paginator.PagerSize (after (mul (sub $paginator.PageNumber 1) $paginator.PagerSize) $list) }}
{{ page.Store.Set "paginator" $paginator }}
{{ end }}
<!-- Initialize list elements -->

View File

@@ -269,7 +269,7 @@
<a class="nav-link dropdown-toggle d-none d-{{ $size }}-block" role="button" data-bs-toggle="dropdown" aria-label="{{ T "languageSwitcherLabel" }}" aria-expanded="false">
{{- partial "assets/icon.html" (dict "icon" "fas globe fa-fw" "spacing" false) }}
</a>
<ul class="dropdown-menu dropdown-menu-end " id="language-selector">
<ul class="dropdown-menu dropdown-menu-end " id="language-selector" data-translated="{{ $page.IsTranslated }}">
{{- if $page.IsTranslated -}}
{{- range $page.AllTranslations -}}
<li><a class="dropdown-item {{ if eq .Language.Lang $currentLang }}active{{ end }}" hreflang="{{.Language.Lang}}" href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>

View File

@@ -0,0 +1,41 @@
<!--
Copyright © 2022 - 2025 The Hinode Team / Mark Dumay. All rights reserved.
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
Visit gethinode.com/license for more details.
-->
<!-- TODO: merge with version.html -->
{{- define "partials/assets/version/mod.html" -}}
{{- $file := "go.mod" -}}
{{- $regex := printf `github.com/gethinode/hinode v.*(\r\n|\r|\n)` -}}
{{- $match := findRE $regex (readFile $file) -}}
{{- $result := "" -}}
{{- if gt (len $match) 0 -}}
{{- $result = (index (split (index $match 0) " ") 1) -}}
{{- $result = strings.TrimPrefix "v" $result -}}
{{- end -}}
{{- return $result -}}
{{- end -}}
{{- define "partials/assets/version/package.html" -}}
{{- $file := "data/package-hinode.json" -}}
{{ $data := dict }}
{{ $version := "" }}
{{ with resources.Get $file }}
{{ with . | transform.Unmarshal }}
{{ $data = . }}
{{ $version = index $data "version" }}
{{ end }}
{{ end }}
{{ return $version }}
{{- end -}}
{{- $version := partial "assets/version/mod.html" . -}}
{{ if not $version }}
{{- $version = partial "assets/version/package.html" . -}}
{{ end }}
{{- print $version -}}

View File

@@ -1,5 +1,5 @@
{{ define "head" }}
{{- $version := strings.TrimPrefix "v" (partialCached "assets/version.html" .) -}}
{{- $version := strings.TrimSpace (partial "assets/theme-version.html" .) -}}
{{ $desc := .Page.Description | default (.Page.Content | safeHTML | truncate 150) -}}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -7,7 +7,6 @@
<meta name="theme" content="{{ printf "Hinode %s" $version }}">
{{ partialCached "head/stylesheet-core.html" . -}}
{{ $config := page.Scratch.Get "modules" }}
{{ if not $config }}
{{ errorf "partial [head/head.html] - Cannot initialize module configuration" }}

View File

@@ -3,9 +3,9 @@
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:title" content="{{ $.Scratch.Get "title" }}">
<meta property="og:description" content="{{ $.Scratch.Get "description" }}">
{{ if $.Scratch.Get "paginator" -}}
{{ $paginator := .Paginate (where .Site.RegularPages.ByDate.Reverse "Section" "blog" ) -}}
<meta property="og:url" content="{{ .Paginator.URL | absURL }}">
{{ $paginator := $.Store.Get "paginator" }}
{{ if $paginator }}
<meta property="og:url" content="{{ $paginator.URL | absURL }}">
{{ else -}}
<meta property="og:url" content="{{ .Permalink }}">
{{ end -}}

View File

@@ -63,13 +63,15 @@
<meta name="description" content="{{ $.Scratch.Get "description" }}">
{{ if $.Scratch.Get "paginator" }}
<link rel="canonical" href="{{ .Paginator.URL | absURL }}">
{{ if .Paginator.HasPrev -}}
<link rel="prev" href="{{ .Paginator.Prev.URL | absURL }}">
{{ $paginator := $.Store.Get "paginator" }}
{{ if $paginator }}
<link rel="canonical" href="{{ $paginator.URL | absURL }}">
{{ if $paginator.HasPrev -}}
<link rel="prev" href="{{ $paginator.Prev.URL | absURL }}">
{{ end -}}
{{ if .Paginator.HasNext -}}
<link rel="next" href="{{ .Paginator.Next.URL | absURL }}">
{{ if $paginator.HasNext -}}
<link rel="next" href="{{ $paginator.Next.URL | absURL }}">
{{ end -}}
{{ end -}}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@gethinode/hinode",
"version": "0.27.20",
"version": "0.27.23",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@gethinode/hinode",
"version": "0.27.20",
"version": "0.27.23",
"license": "MIT",
"dependencies": {
"@fullhuman/postcss-purgecss": "^7.0.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.27.20",
"version": "0.27.23",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",