Compare commits

..

7 Commits

Author SHA1 Message Date
Mark Dumay
863b81efbb Merge pull request #1494 from gethinode/develop
feat: extend navbar styling options
2025-07-04 12:56:42 +02:00
Mark Dumay
9b0683d176 Merge branch 'main' into develop 2025-07-04 12:51:29 +02:00
Mark Dumay
dd1b2eb97f feat: extend navbar styling options 2025-07-04 12:50:41 +02:00
Mark Dumay
3f6dc3b2d7 Merge pull request #1493 from gethinode/develop
Develop
2025-07-04 07:43:32 +02:00
Mark Dumay
873277b691 Merge branch 'main' into develop 2025-07-04 07:38:09 +02:00
Mark Dumay
7a456a12d2 fix: improve handling of static svg files
Removes the subfolder from the static file path, if any. Only applicable to sites deployed to a subfolder (when setting `baseURL`).
2025-07-04 07:36:22 +02:00
Mark Dumay
b437b414b0 fix: suppress empty class and origin of svg files 2025-07-04 07:14:38 +02:00
7 changed files with 19 additions and 6 deletions

View File

@@ -84,6 +84,7 @@
[navigation] [navigation]
anchor = true anchor = true
logo = "/img/logo_icon.svg" logo = "/img/logo_icon.svg"
logo-height = 30
color = "body" color = "body"
fixed = true fixed = true
overlay = false overlay = false
@@ -96,6 +97,9 @@
toc = true toc = true
sidebar = true sidebar = true
size = "md" size = "md"
[navigation.padding]
x = 4
y = 4
# toml-docs-end navigation # toml-docs-end navigation
# toml-docs-start messages # toml-docs-start messages

View File

@@ -37,6 +37,7 @@
[navigation] [navigation]
anchor = true anchor = true
logo = "/img/logo_icon.svg" logo = "/img/logo_icon.svg"
logo-height = 30
color = "body" color = "body"
fixed = true fixed = true
overlay = false overlay = false
@@ -50,6 +51,9 @@
toc = true toc = true
sidebar = true sidebar = true
size = "md" size = "md"
[navigation.padding]
x = 4
y = 4
[messages] [messages]
placement = "bottom-right" placement = "bottom-right"

2
go.mod
View File

@@ -18,7 +18,7 @@ require (
github.com/gethinode/mod-simple-datatables v1.1.7 // indirect github.com/gethinode/mod-simple-datatables v1.1.7 // indirect
github.com/gethinode/mod-simple-datatables/v2 v2.0.1 // indirect github.com/gethinode/mod-simple-datatables/v2 v2.0.1 // indirect
github.com/gethinode/mod-utils/v3 v3.3.1 // indirect github.com/gethinode/mod-utils/v3 v3.3.1 // indirect
github.com/gethinode/mod-utils/v4 v4.9.2 // indirect github.com/gethinode/mod-utils/v4 v4.10.0 // indirect
github.com/nextapps-de/flexsearch v0.0.0-20250606060143-c28f52c09b7a // indirect github.com/nextapps-de/flexsearch v0.0.0-20250606060143-c28f52c09b7a // indirect
github.com/twbs/bootstrap v5.3.7+incompatible // indirect github.com/twbs/bootstrap v5.3.7+incompatible // indirect
) )

2
go.sum
View File

@@ -458,6 +458,8 @@ github.com/gethinode/mod-utils/v4 v4.9.1 h1:9D2AJcrlS5r2moHEoo70GrNBmq1pJHd9oT4G
github.com/gethinode/mod-utils/v4 v4.9.1/go.mod h1:bYmvRdAo4ICy5MpSGafDvO4p5bTDpsDKFCPL3bH0mN4= github.com/gethinode/mod-utils/v4 v4.9.1/go.mod h1:bYmvRdAo4ICy5MpSGafDvO4p5bTDpsDKFCPL3bH0mN4=
github.com/gethinode/mod-utils/v4 v4.9.2 h1:lzcihwAsm8R2k2v+tWu5nfWvXMA8uRKi0nGIzZCygZ8= github.com/gethinode/mod-utils/v4 v4.9.2 h1:lzcihwAsm8R2k2v+tWu5nfWvXMA8uRKi0nGIzZCygZ8=
github.com/gethinode/mod-utils/v4 v4.9.2/go.mod h1:bYmvRdAo4ICy5MpSGafDvO4p5bTDpsDKFCPL3bH0mN4= github.com/gethinode/mod-utils/v4 v4.9.2/go.mod h1:bYmvRdAo4ICy5MpSGafDvO4p5bTDpsDKFCPL3bH0mN4=
github.com/gethinode/mod-utils/v4 v4.10.0 h1:CfVa57r52wXd0bUqSJlpux2cloHQNBBe13aeqLJ8FXE=
github.com/gethinode/mod-utils/v4 v4.10.0/go.mod h1:bYmvRdAo4ICy5MpSGafDvO4p5bTDpsDKFCPL3bH0mN4=
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 h1:H/qVR5O4BXjRjD+5PZB+r4ug2BSJ2Of4RtwOntd+OKo= github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 h1:H/qVR5O4BXjRjD+5PZB+r4ug2BSJ2Of4RtwOntd+OKo=
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU= github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU=
github.com/nextapps-de/flexsearch v0.0.0-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg= github.com/nextapps-de/flexsearch v0.0.0-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg=

View File

@@ -77,10 +77,10 @@
{{- with $wrapper }}<div class="{{ . }}">{{ end }} {{- with $wrapper }}<div class="{{ . }}">{{ end }}
{{- end -}} {{- end -}}
{{- if $data -}} {{- if $data -}}
{{- if site.Params.debugging.includeSVGOrigin -}} {{- if and site.Params.debugging.includeSVGOrigin $.url -}}
{{- printf "{{/* <svg src=\"%s\"> */}}" $.url | safeHTML -}} {{- printf "{{/* <svg src=\"%s\"> */}}" $.url | safeHTML -}}
{{- end -}} {{- end -}}
{{- $data = replace $data "<svg" (printf "<svg class=\"%s\"" $args.class) -}} {{- with $args.class }}{{ $data = replace $data "<svg" (printf "<svg class=\"%s\"" .) }}{{ end -}}
{{- $data | safeHTML -}} {{- $data | safeHTML -}}
{{- else if not $fileAnchor -}} {{- else if not $fileAnchor -}}
<img class="img-fluid {{ $args.class }}" <img class="img-fluid {{ $args.class }}"

View File

@@ -67,7 +67,9 @@
{{- if hasSuffix $src "svg" -}} {{- if hasSuffix $src "svg" -}}
{{- $res = partial "utilities/GetResource.html" (dict "url" $src "page" $args.page) -}} {{- $res = partial "utilities/GetResource.html" (dict "url" $src "page" $args.page) -}}
{{ if not $res }} {{ if not $res }}
{{- $targetURL := partial "utilities/GetStaticURL" (dict "url" (strings.TrimPrefix "/static" $src)) -}} {{- $targetURL := strings.TrimPrefix "/static" $src -}}
{{- $u := urls.Parse site.BaseURL }}
{{- $targetURL = strings.TrimPrefix $u.Path $src -}}
{{- if not (fileExists (path.Join "/static" $targetURL)) -}} {{- if not (fileExists (path.Join "/static" $targetURL)) -}}
{{ warnf "Cannot find vector image resource: %q" $src -}} {{ warnf "Cannot find vector image resource: %q" $src -}}
{{ else }} {{ else }}

View File

@@ -80,7 +80,7 @@
{{ end }} {{ end }}
{{/* Initialize global variables */}} {{/* Initialize global variables */}}
{{- $padding := partial "utilities/GetPadding.html" -}} {{- $padding := partial "utilities/GetPadding.html" (dict "section" "navigation") -}}
{{/* Initialize local arguments */}} {{/* Initialize local arguments */}}
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}} {{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
@@ -124,7 +124,8 @@
{{ $logo := "" }} {{ $logo := "" }}
{{ with $args.logo | default site.Params.navigation.logo }} {{ with $args.logo | default site.Params.navigation.logo }}
{{ $logo = partial "assets/image.html" (dict "src" . "loading" "eager" "title" $title "image-height" 30) }} {{ $height := index site.Params.navigation "logo-height" | default 30 }}
{{ $logo = partial "assets/image.html" (dict "src" . "loading" "eager" "title" $title "image-height" $height) }}
{{ end }} {{ end }}
{{- $pre := $args.pre -}} {{- $pre := $args.pre -}}