mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-17 23:13:11 +00:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d0d681a6a9 | ||
![]() |
0d6964c7ed | ||
![]() |
3090aaa810 | ||
![]() |
c7cf48a6c1 | ||
![]() |
300a473a37 | ||
![]() |
dac09afbba | ||
![]() |
a35e59df3d | ||
![]() |
51b80d8820 | ||
![]() |
28c12e61e9 | ||
![]() |
c2d4782375 | ||
![]() |
4aa5723235 |
@@ -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"
|
||||
|
2
go.mod
2
go.mod
@@ -8,7 +8,7 @@ require (
|
||||
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.6 // indirect
|
||||
github.com/gethinode/mod-google-analytics v1.1.9 // 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.13 // indirect
|
||||
|
2
go.sum
2
go.sum
@@ -154,6 +154,8 @@ github.com/gethinode/mod-google-analytics v1.1.5 h1:wlOcgwNEJAnIQmPJIo3cT06xnr1d
|
||||
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-google-analytics v1.1.9 h1:ld3bRGiJiUCfe/deH+4vOP3oZNhG6mPssT254EcK0Ro=
|
||||
github.com/gethinode/mod-google-analytics v1.1.9/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=
|
||||
|
@@ -6,6 +6,16 @@
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
<!-- Limits a title to a maximum of 33 runes, adds a "..." suffix otherwise -->
|
||||
{{ define "partials/short-title.html" }}
|
||||
{{- $title := . -}}
|
||||
{{ if gt (strings.RuneCount $title) 33 }}
|
||||
{{ $title = print (substr $title 0 30) "..." }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $title }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "breadcrumb" "args" . "group" "partial") }}
|
||||
{{- errorf "partial [assets/breadcrumb.html] - Invalid arguments" -}}
|
||||
@@ -13,23 +23,41 @@
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments -->
|
||||
{{ $page := .page }}
|
||||
{{- $page := .page -}}
|
||||
{{- $breakpoint := $page.Scratch.Get "breakpoint" -}}
|
||||
|
||||
<!-- Include breadcrumb items that have both a title and address -->
|
||||
{{ $items := slice }}
|
||||
{{- range $index, $item := $page.Ancestors.Reverse -}}
|
||||
{{- $title := .LinkTitle -}}
|
||||
{{- if .IsHome }}{{ $title = T "home" }}{{ end -}}
|
||||
{{- $address := or .RelPermalink .Params.Redirect -}}
|
||||
{{ if and $title $address}}
|
||||
{{ $items = $items | append (dict "title" $title "address" $address) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Main code -->
|
||||
{{ if not $error }}
|
||||
<nav aria-label="breadcrumb">
|
||||
<nav aria-label="breadcrumb" class="d-{{ $breakpoint.prev }}-none">
|
||||
<ol class="breadcrumb">
|
||||
{{- range $index, $item := $page.Ancestors.Reverse -}}
|
||||
{{- $title := .LinkTitle -}}
|
||||
{{- if .IsHome }}{{ $title = T "home" }}{{ end -}}
|
||||
{{- $address := or .RelPermalink .Params.Redirect -}}
|
||||
{{ if $title }}
|
||||
{{ if $address }}
|
||||
<li class="breadcrumb-item"><a href="{{ $address }}">{{ $title }}</a></li>
|
||||
{{ else }}
|
||||
<li class="breadcrumb-item">{{ $title }}</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- $length := len $items -}}
|
||||
{{- if gt $length 0 -}}
|
||||
{{ $item := index $items (sub $length 1) }}
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{{ $item.address }}">
|
||||
{{ partial "assets/icon.html" (dict "icon" "fas angle-left") }} {{ partial "short-title" $item.title }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<nav aria-label="breadcrumb" class="d-none d-{{ $breakpoint.prev }}-block">
|
||||
<ol class="breadcrumb">
|
||||
{{- $length := len $items }}
|
||||
{{- range $index, $item := $items -}}
|
||||
<li class="breadcrumb-item"><a href="{{ $item.address }}">{{ $item.title }}</a></li>
|
||||
{{- end -}}
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $page.LinkTitle }}</li>
|
||||
</ol>
|
||||
|
41
layouts/partials/assets/theme-version.html
Normal file
41
layouts/partials/assets/theme-version.html
Normal 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 -}}
|
@@ -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" }}
|
||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.27.21",
|
||||
"version": "0.27.24",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.27.21",
|
||||
"version": "0.27.24",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fullhuman/postcss-purgecss": "^7.0.2",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.27.21",
|
||||
"version": "0.27.24",
|
||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||
"keywords": [
|
||||
"hugo",
|
||||
|
Reference in New Issue
Block a user