Compare commits

...

25 Commits

Author SHA1 Message Date
Mark Dumay
29bcb26d04 Merge pull request #1116 from gethinode/develop
Enable embedded Font Awesome icons
2024-08-17 16:02:43 +02:00
Mark Dumay
e04a8dc0ed Enable embedded Font Awesome icons
Fixes #394
2024-08-17 15:56:55 +02:00
Mark Dumay
c7e70bf933 Merge pull request #1114 from gethinode/download-link
Support links to static files and page resources
2024-08-17 15:44:15 +02:00
Mark Dumay
1700abc7de Merge branch 'main' into download-link 2024-08-17 14:57:41 +02:00
Mark Dumay
3ef857dba9 Fix link error 2024-08-17 08:00:03 +02:00
Mark Dumay
5acc2e8f9e Support links to static files and page resources 2024-08-16 19:05:07 +02:00
Mark Dumay
0caa00a1a1 Merge pull request #1112 from gethinode/develop
Support embedding of vector image assets
2024-08-16 16:23:19 +02:00
Mark Dumay
b27a5ac7cb Merge branch 'main' into develop 2024-08-16 16:14:19 +02:00
Mark Dumay
24261c9193 Support embedding of vector image assets 2024-08-16 16:13:42 +02:00
github-actions[bot]
d1aa9c0f7c Merge pull request #1111 from gethinode/dependabot/npm_and_yarn/stylelint-16.8.2
Bump stylelint from 16.8.1 to 16.8.2
2024-08-16 13:12:21 +00:00
dependabot[bot]
a18d387379 Bump stylelint from 16.8.1 to 16.8.2
Bumps [stylelint](https://github.com/stylelint/stylelint) from 16.8.1 to 16.8.2.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/16.8.1...16.8.2)

---
updated-dependencies:
- dependency-name: stylelint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-16 13:07:34 +00:00
Mark Dumay
2d9cbf9195 Merge pull request #1110 from gethinode/develop
Add assistive label to featured icons
2024-08-16 14:21:22 +02:00
Mark Dumay
64abda14ce Merge branch 'main' into develop 2024-08-16 14:15:55 +02:00
Mark Dumay
3625675577 Bump package release 2024-08-16 14:14:55 +02:00
Mark Dumay
e6e115a65d Update build stats 2024-08-16 14:12:34 +02:00
Mark Dumay
9832b566db Add assistive label to featured icons
Fixes #1106
2024-08-16 14:12:21 +02:00
Mark Dumay
f3211eabe0 Merge pull request #1109 from gethinode/develop
Fix reference to base URL in links
2024-08-16 13:52:15 +02:00
Mark Dumay
82c1d00af4 Merge branch 'main' into develop 2024-08-16 13:38:17 +02:00
Mark Dumay
70386eaeec Fix reference to base URL in links 2024-08-16 13:37:38 +02:00
Mark Dumay
7413155dea Merge pull request #1108 from gethinode/develop
Fix embedded and anchor links
2024-08-16 11:04:54 +02:00
Mark Dumay
cfd1706f5f Merge branch 'main' into develop 2024-08-16 10:58:37 +02:00
Mark Dumay
5eca63c50d Fix embedded and anchor links 2024-08-16 10:58:05 +02:00
Mark Dumay
d3f471a281 Merge pull request #1107 from gethinode/develop
Use utility function to retrieve the page associated with a card
2024-08-16 10:55:56 +02:00
Mark Dumay
b4acd7aef2 Merge branch 'main' into develop 2024-08-16 10:51:11 +02:00
Mark Dumay
49a3ef3c42 Use utility function to retrieve the page associated with a card 2024-08-16 10:50:36 +02:00
16 changed files with 176 additions and 151 deletions

View File

@@ -32,6 +32,7 @@
showJS = false showJS = false
showSCSS = false showSCSS = false
purgeHTMLComments = false purgeHTMLComments = false
includeSVGOrigin = true
# toml-docs-end debugging # toml-docs-end debugging
# toml-docs-start docs # toml-docs-start docs

View File

@@ -18,6 +18,7 @@
showJS = false showJS = false
showSCSS = false showSCSS = false
purgeHTMLComments = true # prevents a Goldmark warning when processing HTML comments (as used by markdownlint) purgeHTMLComments = true # prevents a Goldmark warning when processing HTML comments (as used by markdownlint)
includeSVGOrigin = true
[docs] [docs]
basePath = "/" # TODO: replace basePath = "/" # TODO: replace

View File

@@ -52,6 +52,7 @@
"sub", "sub",
"sup", "sup",
"svg", "svg",
"symbol",
"table", "table",
"tbody", "tbody",
"td", "td",
@@ -519,11 +520,42 @@
"collapse", "collapse",
"collapse-1", "collapse-1",
"command-prompt", "command-prompt",
"custom-activity",
"data-tables", "data-tables",
"docs", "docs",
"documentation", "documentation",
"example", "example",
"exemple", "exemple",
"fa-face-frown",
"fa-square-check",
"fab-bootstrap",
"fab-docker",
"fab-facebook",
"fab-github",
"fab-linkedin",
"fab-medium",
"fab-whatsapp",
"fab-x-twitter",
"fas-angle-left",
"fas-angle-right",
"fas-angles-left",
"fas-angles-right",
"fas-arrow-left",
"fas-arrow-right",
"fas-circle-check",
"fas-code",
"fas-ellipsis",
"fas-globe",
"fas-heart",
"fas-house",
"fas-link",
"fas-magnifying-glass",
"fas-moon",
"fas-rocket",
"fas-share-nodes",
"fas-sort",
"fas-sun",
"fas-up-right-from-square",
"fichier", "fichier",
"fil-dariane", "fil-dariane",
"file", "file",

4
go.mod
View File

@@ -6,12 +6,12 @@ require (
github.com/airbnb/lottie-web v5.12.2+incompatible // indirect github.com/airbnb/lottie-web v5.12.2+incompatible // indirect
github.com/gethinode/mod-bootstrap v1.3.1 // indirect github.com/gethinode/mod-bootstrap v1.3.1 // indirect
github.com/gethinode/mod-flexsearch/v2 v2.0.1 // indirect github.com/gethinode/mod-flexsearch/v2 v2.0.1 // indirect
github.com/gethinode/mod-fontawesome v1.9.1 // indirect github.com/gethinode/mod-fontawesome v1.10.0 // indirect
github.com/gethinode/mod-katex v1.1.2 // indirect github.com/gethinode/mod-katex v1.1.2 // indirect
github.com/gethinode/mod-leaflet v1.1.1 // indirect github.com/gethinode/mod-leaflet v1.1.1 // indirect
github.com/gethinode/mod-lottie v1.5.6 // indirect github.com/gethinode/mod-lottie v1.5.6 // indirect
github.com/gethinode/mod-simple-datatables v1.0.7 // indirect github.com/gethinode/mod-simple-datatables v1.0.7 // indirect
github.com/gethinode/mod-utils/v2 v2.3.10 // indirect github.com/gethinode/mod-utils/v2 v2.4.0 // indirect
github.com/nextapps-de/flexsearch v0.0.0-20240501124520-961c3ae84a87 // indirect github.com/nextapps-de/flexsearch v0.0.0-20240501124520-961c3ae84a87 // indirect
github.com/twbs/bootstrap v5.3.3+incompatible // indirect github.com/twbs/bootstrap v5.3.3+incompatible // indirect
) )

4
go.sum
View File

@@ -116,6 +116,8 @@ github.com/gethinode/mod-fontawesome v1.9.0 h1:xqUB8AnezMHAt8lye4ksqvmHSVPCOkiHs
github.com/gethinode/mod-fontawesome v1.9.0/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y= github.com/gethinode/mod-fontawesome v1.9.0/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y=
github.com/gethinode/mod-fontawesome v1.9.1 h1:cQk84vriqffM4fuUUoM9j3SSD+3ppeW2j4ta7AiToMU= github.com/gethinode/mod-fontawesome v1.9.1 h1:cQk84vriqffM4fuUUoM9j3SSD+3ppeW2j4ta7AiToMU=
github.com/gethinode/mod-fontawesome v1.9.1/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y= github.com/gethinode/mod-fontawesome v1.9.1/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y=
github.com/gethinode/mod-fontawesome v1.10.0 h1:Izs2AKc+YVBa1TywcH54OKLTNCUMXRoFIqOs+n0FgOo=
github.com/gethinode/mod-fontawesome v1.10.0/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y=
github.com/gethinode/mod-katex v1.0.0 h1:me/3dIIZBkfk1mRIFt8QiAGYwYDoSG5bc2hHRtIutFc= 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.0/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
github.com/gethinode/mod-katex v1.0.1 h1:809QUztxmKgMNchU+v03iMO7Ma+ISc3ZzhXYauc21rs= github.com/gethinode/mod-katex v1.0.1 h1:809QUztxmKgMNchU+v03iMO7Ma+ISc3ZzhXYauc21rs=
@@ -258,6 +260,8 @@ github.com/gethinode/mod-utils/v2 v2.3.9 h1:Z9uAr6S0wunlkfKHa2D/U83fBV6Ivtf+7sjB
github.com/gethinode/mod-utils/v2 v2.3.9/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY= github.com/gethinode/mod-utils/v2 v2.3.9/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.3.10 h1:+coUXdgAbLEE8Tvb3Rfk/1Nr6oDVreXI2sil0pa/n2Q= github.com/gethinode/mod-utils/v2 v2.3.10 h1:+coUXdgAbLEE8Tvb3Rfk/1Nr6oDVreXI2sil0pa/n2Q=
github.com/gethinode/mod-utils/v2 v2.3.10/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY= github.com/gethinode/mod-utils/v2 v2.3.10/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.4.0 h1:mmG4hWaeA4krAg933pibH+TrjFmPHkAi/DUbe3SM38I=
github.com/gethinode/mod-utils/v2 v2.4.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
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

@@ -2,13 +2,11 @@
"htmlElements": { "htmlElements": {
"tags": [ "tags": [
"a", "a",
"annotation",
"body", "body",
"button", "button",
"div", "div",
"footer", "footer",
"form", "form",
"h5",
"head", "head",
"html", "html",
"img", "img",
@@ -16,35 +14,20 @@
"label", "label",
"li", "li",
"link", "link",
"math",
"meta", "meta",
"mfrac",
"mi",
"mn",
"mo",
"mpadded",
"mphantom",
"mrow",
"mspace",
"msqrt",
"mstyle",
"msub",
"msup",
"mtext",
"munder",
"nav", "nav",
"noscript",
"ol", "ol",
"p", "p",
"path", "path",
"script", "script",
"semantics",
"small", "small",
"span", "span",
"strong", "strong",
"svg", "svg",
"symbol",
"title", "title",
"ul" "ul",
"use"
], ],
"classes": [ "classes": [
"active", "active",
@@ -55,7 +38,6 @@
"bg-body", "bg-body",
"bg-opacity-10", "bg-opacity-10",
"bg-primary", "bg-primary",
"border-0",
"bottom-0", "bottom-0",
"bottom-bar", "bottom-bar",
"breadcrumb", "breadcrumb",
@@ -63,19 +45,10 @@
"btn", "btn",
"btn-close", "btn-close",
"btn-primary", "btn-primary",
"btn-social",
"card",
"card-body",
"card-body-link",
"card-text",
"card-title",
"card-zoom",
"checkbox", "checkbox",
"col", "col",
"col-12", "col-12",
"col-6", "col-6",
"col-lg-2",
"col-lg-8",
"col-md-2", "col-md-2",
"col-md-3", "col-md-3",
"col-md-4", "col-md-4",
@@ -88,9 +61,7 @@
"container-xxl", "container-xxl",
"d-flex", "d-flex",
"d-inline", "d-inline",
"d-lg-block",
"d-md-block", "d-md-block",
"d-md-none",
"d-none", "d-none",
"display-1", "display-1",
"display-4", "display-4",
@@ -102,17 +73,12 @@
"fa-book-open", "fa-book-open",
"fa-ellipsis", "fa-ellipsis",
"fa-face-frown", "fa-face-frown",
"fa-facebook",
"fa-fw", "fa-fw",
"fa-github", "fa-github",
"fa-link",
"fa-linkedin", "fa-linkedin",
"fa-medium", "fa-medium",
"fa-moon", "fa-moon",
"fa-share-nodes",
"fa-sun", "fa-sun",
"fa-whatsapp",
"fa-x-twitter",
"fab", "fab",
"fas", "fas",
"fixed-top", "fixed-top",
@@ -122,13 +88,8 @@
"form-control", "form-control",
"fs-3", "fs-3",
"fs-5", "fs-5",
"fs-6",
"fs-lg-5",
"fw-30", "fw-30",
"fw-bold", "fw-bold",
"g-4",
"gap-1",
"h-100",
"hstack", "hstack",
"img-fluid", "img-fluid",
"img-wrap", "img-wrap",
@@ -137,17 +98,11 @@
"justify-content-center", "justify-content-center",
"justify-content-end", "justify-content-end",
"justify-content-start", "justify-content-start",
"katex",
"label", "label",
"lead",
"link-bg-footer", "link-bg-footer",
"link-secondary", "link-secondary",
"main-content", "main-content",
"main-nav-toggler", "main-nav-toggler",
"mb-3",
"mb-4",
"mb-5",
"mb-lg-5",
"me-auto", "me-auto",
"middle-bar", "middle-bar",
"min-vh-100", "min-vh-100",
@@ -159,7 +114,6 @@
"mx-auto", "mx-auto",
"mx-md-0", "mx-md-0",
"my-auto", "my-auto",
"my-md-0",
"my-md-auto", "my-md-auto",
"nav-item", "nav-item",
"nav-link", "nav-link",
@@ -173,11 +127,6 @@
"navbar-nav", "navbar-nav",
"navbar-toggler", "navbar-toggler",
"no-js", "no-js",
"offcanvas",
"offcanvas-body",
"offcanvas-header",
"offcanvas-start",
"offcanvas-title",
"order-0", "order-0",
"order-1", "order-1",
"order-md-0", "order-md-0",
@@ -187,11 +136,11 @@
"p-3", "p-3",
"p-4", "p-4",
"pb-4", "pb-4",
"pb-5",
"pb-md-0", "pb-md-0",
"position-fixed", "position-fixed",
"position-relative", "position-relative",
"ps-1", "ps-1",
"pt-4",
"pt-5", "pt-5",
"pt-md-3", "pt-md-3",
"px-4", "px-4",
@@ -201,48 +150,40 @@
"row", "row",
"row-cols-1", "row-cols-1",
"row-cols-2", "row-cols-2",
"row-cols-lg-3",
"row-cols-md-2", "row-cols-md-2",
"row-cols-md-3",
"row-cols-sm-2",
"row-cols-sm-3", "row-cols-sm-3",
"search", "search",
"search-input", "search-input",
"search-suggestions", "search-suggestions",
"shadow", "shadow",
"sidebar-overflow",
"sticky-top",
"stretched-link",
"svg-inline--fa", "svg-inline--fa",
"text-body-secondary",
"text-center", "text-center",
"text-decoration-none", "text-decoration-none",
"text-end",
"text-muted", "text-muted",
"text-secondary", "text-secondary",
"text-sm-start", "text-sm-start",
"text-start", "text-start",
"text-uppercase",
"toast", "toast",
"toast-body", "toast-body",
"toast-container", "toast-container",
"toast-header", "toast-header",
"toc",
"toc-sidebar",
"toggler-icon", "toggler-icon",
"top-bar" "top-bar"
], ],
"ids": [ "ids": [
"blogs", "fa-face-frown",
"btn-webshare", "fab-github",
"fab-linkedin",
"fab-medium",
"fas-book-open",
"fas-ellipsis",
"fas-moon",
"fas-sun",
"navbar-0-collapse", "navbar-0-collapse",
"navbar-mode", "navbar-mode",
"navbar-mode-checkbox", "navbar-mode-checkbox",
"offcanvas-label",
"offcanvass-sidebar",
"toast-container", "toast-container",
"toast-copied-code-message", "toast-copied-code-message"
"toast-message-email-4"
] ]
} }
} }

View File

@@ -1,8 +1,10 @@
{{ if gt (findRE `^HAHAHUGO` .Destination 1) 0 }} {{ if gt (findRE `^HAHAHUGO` .Destination 1) 0 }}
{{ errorf "Invalid markdown link destination, use '%s' syntax when using shortcodes as input. See '%s'" {{ errorf "Invalid markdown link destination, use '%s' syntax when using shortcodes as input. See '%s'"
("&#123;&#123;% %&#125;&#125;" | htmlUnescape) ("&#123;&#123;% %&#125;&#125;" | htmlUnescape)
.Page.File.Filename .Page.File.Path
}} }}
{{ else if not .Destination }}
{{ errorf "Missing markdown link destination, see '%s'" .Page.File.Path }}
{{ else }} {{ else }}
{{ partial "assets/link.html" (dict {{ partial "assets/link.html" (dict
"destination" .Destination "destination" .Destination
@@ -10,4 +12,4 @@
"text" .Text "text" .Text
"title" .Title "title" .Title
) }} ) }}
{{ end }} {{- end }}

View File

@@ -73,6 +73,7 @@
{{ end }} {{ end }}
{{- partial "footer/toast-container.html" . -}} {{- partial "footer/toast-container.html" . -}}
{{- partial "assets/symbols.html" . -}}
{{- partialCached "footer/scripts.html" (dict "header" false "page" . "core" true) }} {{- partialCached "footer/scripts.html" (dict "header" false "page" . "core" true) }}
{{- partial "footer/optional-scripts.html" . -}} {{- partial "footer/optional-scripts.html" . -}}
</body> </body>

View File

@@ -51,9 +51,13 @@
<!-- Override arguments --> <!-- Override arguments -->
{{- $page := "" }} {{- $page := "" }}
{{- if .path }} {{- if .path }}
{{- $page = site.GetPage .path }} {{ $page = partial "utilities/GetPage.html" (dict "url" .path "page" page) }}
{{- if not $page }} {{- if not $page }}
{{- errorf "partial [assets/card.html] - Cannot find page: %s" .path -}} {{ if page.File }}
{{- errorf "partial [assets/card.html] - Cannot find target page '%s', see '%s'" .path page.File.Path -}}
{{ else }}
{{- errorf "partial [assets/card.html] - Cannot find target page '%s'" .path -}}
{{ end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with $page -}} {{- with $page -}}

View File

@@ -41,6 +41,7 @@
{{ $imgset := index $target "set" }} {{ $imgset := index $target "set" }}
{{ $height := index $target "height" }} {{ $height := index $target "height" }}
{{ $width := index $target "width" }} {{ $width := index $target "width" }}
{{ $data := index $target "data" }}
<!-- Add color modes --> <!-- Add color modes -->
{{- range $none := $modes -}} {{- range $none := $modes -}}
@@ -55,7 +56,14 @@
{{ else }} {{ else }}
{{ with $wrapper }}<div class="{{ . }}">{{ end }} {{ with $wrapper }}<div class="{{ . }}">{{ end }}
{{ end }} {{ end }}
{{- if not $fileAnchor -}}
{{ if $data }}
{{- if site.Params.debugging.includeSVGOrigin }}
{{ printf "<!-- <svg src=\"%s\"> -->" $.url | safeHTML }}
{{ end -}}
{{- $data = replace $data "<svg" (printf "<svg class=\"%s\"" $class) -}}
{{- $data | safeHTML -}}
{{- else if not $fileAnchor -}}
<img class="img-fluid {{ $class }}" <img class="img-fluid {{ $class }}"
src="{{ $fallbackURL }}" src="{{ $fallbackURL }}"
{{ if $lazy }}loading="lazy"{{ end }} {{ if $lazy }}loading="lazy"{{ end }}

View File

@@ -47,6 +47,7 @@
{{ $dims := slice }} {{ $dims := slice }}
{{- $res := "" -}} {{- $res := "" -}}
{{- $img := "" -}} {{- $img := "" -}}
{{- $data := "" -}}
{{ $transform := "" }} {{ $transform := "" }}
{{- if hasSuffix $url "svg" -}} {{- if hasSuffix $url "svg" -}}
{{- $res = partial "utilities/GetResource.html" (dict "url" $url "page" $page) -}} {{- $res = partial "utilities/GetResource.html" (dict "url" $url "page" $page) -}}
@@ -61,6 +62,10 @@
{{ $dims = $dims | append "500" }} {{ $dims = $dims | append "500" }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ else if eq (string $res.MediaType) "image/svg+xml" }}
{{ $data = $res.Content }}
{{ else }}
{{ warnf "Unsupported media type '%s': %q" (string $res.MediaType) $url -}}
{{ end }} {{ end }}
{{ else if $ratio }} {{ else if $ratio }}
{{ $transform = "fill" }} {{ $transform = "fill" }}
@@ -137,4 +142,4 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ return (dict "target" $targetURL "set" $set "height" $height "width" $width) }} {{ return (dict "target" $targetURL "set" $set "height" $height "width" $width "data" $data) }}

View File

@@ -14,6 +14,7 @@
<!-- Initialize arguments --> <!-- Initialize arguments -->
{{ $destination := strings.TrimPrefix (strings.TrimSuffix "/" site.BaseURL) .destination }} {{ $destination := strings.TrimPrefix (strings.TrimSuffix "/" site.BaseURL) .destination }}
{{ if not $destination }}{{ $destination = "/" }}{{ end }}
{{- $target := "" -}} {{- $target := "" -}}
{{- $rel := "" -}} {{- $rel := "" -}}
@@ -22,6 +23,7 @@
{{- $cue := .cue | default site.Params.main.externalLinks.cue -}} {{- $cue := .cue | default site.Params.main.externalLinks.cue -}}
{{- $tab := .tab | default site.Params.main.externalLinks.tab -}} {{- $tab := .tab | default site.Params.main.externalLinks.tab -}}
{{- $isExternal := or (ne (urls.Parse (absURL $destination)).Host (urls.Parse site.BaseURL).Host) $external -}} {{- $isExternal := or (ne (urls.Parse (absURL $destination)).Host (urls.Parse site.BaseURL).Host) $external -}}
{{- $isLocal := hasPrefix $destination "#" -}}
{{- $page := .page -}} {{- $page := .page -}}
{{- $anchor := "" -}} {{- $anchor := "" -}}
{{- $text := .text -}} {{- $text := .text -}}
@@ -54,32 +56,50 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if not $isLocal }}
{{ $ref := partial "utilities/GetPage.html" (dict "url" $destination "page" $page) }} {{ $ref := partial "utilities/GetPage.html" (dict "url" $destination "page" $page) }}
{{- if not $ref -}} {{- if not $ref -}}
{{- errorf "partial [assets/link.html] - Cannot find page: %s" $destination -}} {{ $pageContext := "" }}
{{ with $page.File }}{{ $pageContext = path.Join "/content" .Dir }}{{ end }}
{{ $isPageRes := fileExists (path.Join $pageContext $destination) }}
{{ $isStatic := fileExists (path.Join "static" $destination) }}
{{ if and (not $isPageRes) (not $isStatic) }}
{{- errorf "partial [assets/link.html] - Cannot find page or asset: '%s' at '%s'" $destination $page.File.Path -}}
{{- $error = true -}} {{- $error = true -}}
{{- else -}} {{ else if $isPageRes }}
{{ $destination = urls.JoinPath "/" (strings.TrimPrefix "/content" $pageContext) $destination }}
{{ else if $isStatic }}
{{ $destination = urls.JoinPath "/" $destination }}
{{ end }}
{{- with $anchor }}{{ $destination = printf "%s#%s" (strings.TrimSuffix "/" $destination) . -}}{{ end -}}
{{ end }}
{{- if and $ref (not $error) -}}
{{- $destination = $ref.RelPermalink -}} {{- $destination = $ref.RelPermalink -}}
{{- with $anchor }}{{ $destination = printf "%s#%s" (strings.TrimSuffix "/" $destination) . -}}{{ end -}} {{- with $anchor }}{{ $destination = printf "%s#%s" (strings.TrimSuffix "/" $destination) . -}}{{ end -}}
{{- end -}}
{{- if not $text -}} {{- if not $text -}}
{{- if $anchor -}} {{ if $anchor }}{{ $text = $anchor }}{{ else }}{{ $text = $ref.LinkTitle }}{{ end }}
{{- $text = $anchor -}}
{{- else -}}
{{- $text = $ref.LinkTitle -}}
{{- end -}}
{{ end -}} {{ end -}}
{{ else }}
{{ with $anchor }}
{{ $destination = printf "#%s" . }}
{{ if not $text }}{{ $text = . }}{{ end }}
{{ end }}
{{ end }}
{{- if not $case }}{{ $text = lower $text }}{{ end -}} {{- if not $case }}{{ $text = lower $text }}{{ end -}}
{{- end -}}
{{- end -}} {{- end -}}
{{ if not $error -}} {{ if not $error -}}
<a <a
{{- with $destination }} href="{{ . | safeURL }}"{{ end -}} {{- with $destination }} href="{{ . | safeURL }}"{{ end -}}
{{- with $class }}class="{{ . }}" {{ end -}} {{ with $class }} class="{{ . }}" {{ end -}}
{{- with $target }} target="{{ . }}"{{ end -}} {{ with $target }} target="{{ . }}"{{ end -}}
{{- with $rel }} rel="{{ . }}"{{ end -}} {{ with $rel }} rel="{{ . }}"{{ end -}}
{{- with $title }} title="{{ . }}"{{ end -}} {{ with $title }} title="{{ . }}"{{ end -}}
> >
{{- $text -}} {{- $text | safeHTML -}}
</a> </a>
{{- end }} {{- end -}}

View File

@@ -40,7 +40,7 @@
{{- $actions = sort $actions "weight" "asc" -}} {{- $actions = sort $actions "weight" "asc" -}}
<div class="hstack{{ if gt (len $actions) 1 }} gap-1{{ end }} justify-content-{{ $align}} pt-5 pt-md-3"> <div class="hstack{{ if gt (len $actions) 1 }} gap-1{{ end }} justify-content-{{ $align}} pt-5 pt-md-3">
{{ range $actions }} {{ range $actions }}
{{ partial "assets/button.html" (dict "href" .url "icon" .icon "title" .title "outline" .outline "order" "last" "justify" "start") }} {{ partial "assets/button.html" (dict "href" .url "icon" .icon "label" .label "title" .title "outline" .outline "order" "last" "justify" "start") }}
{{ end }} {{ end }}
</div> </div>
{{ end }} {{ end }}

View File

@@ -80,8 +80,14 @@
{{- if not $isExternal -}} {{- if not $isExternal -}}
{{ $ref := partial "utilities/GetPage.html" (dict "url" $url "page" .Page) }} {{ $ref := partial "utilities/GetPage.html" (dict "url" $url "page" .Page) }}
{{- if not $ref -}} {{- if not $ref -}}
{{- errorf "Cannot find page: '%s' at %s" $url .Position -}} {{ $pageContext := "" }}
{{ with .Page.File }}{{ $pageContext = path.Join "/content" .Dir }}{{ end }}
{{ $isPageRes := fileExists (path.Join $pageContext $url) }}
{{ $isStatic := fileExists (path.Join "/static" $url) }}
{{ if and (not $isPageRes) (not $isStatic) }}
{{- errorf "Cannot find page or asset: '%s' at %s" $url .Position -}}
{{- $error = true -}} {{- $error = true -}}
{{ end }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

92
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.26.0", "version": "0.26.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.26.0", "version": "0.26.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@fullhuman/postcss-purgecss": "^6.0.0", "@fullhuman/postcss-purgecss": "^6.0.0",
@@ -30,7 +30,7 @@
"replace-in-files-cli": "^3.0.0", "replace-in-files-cli": "^3.0.0",
"rimraf": "^6.0.1", "rimraf": "^6.0.1",
"shx": "^0.3.4", "shx": "^0.3.4",
"stylelint": "^16.8.1", "stylelint": "^16.8.2",
"stylelint-config-standard-scss": "^13.1.0" "stylelint-config-standard-scss": "^13.1.0"
}, },
"optionalDependencies": { "optionalDependencies": {
@@ -227,9 +227,9 @@
} }
}, },
"node_modules/@csstools/css-parser-algorithms": { "node_modules/@csstools/css-parser-algorithms": {
"version": "2.7.1", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.7.1.tgz", "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.0.tgz",
"integrity": "sha512-2SJS42gxmACHgikc1WGesXLIT8d/q2l0UFM7TaEeIzdFCE/FPMtTiizcPGGJtlPo2xuQzY09OhrLTzRxqJqwGw==", "integrity": "sha512-20hEErXV9GEx15qRbsJVzB91ryayx1F2duHPBrfZXQAHz/dJG0u/611URpr28+sFjm3EI7U17Pj9SVA9NSAGJA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -242,16 +242,16 @@
} }
], ],
"engines": { "engines": {
"node": "^14 || ^16 || >=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"@csstools/css-tokenizer": "^2.4.1" "@csstools/css-tokenizer": "^3.0.0"
} }
}, },
"node_modules/@csstools/css-tokenizer": { "node_modules/@csstools/css-tokenizer": {
"version": "2.4.1", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.4.1.tgz", "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.0.tgz",
"integrity": "sha512-eQ9DIktFJBhGjioABJRtUucoWR2mwllurfnM8LuNGAqX3ViZXaUchqk+1s7jjtkFiT9ySdACsFEA3etErkALUg==", "integrity": "sha512-efZvfJyYrqH9hPCKtOBywlTsCXnEzAI9sLHFzUsDpBb+1bQ+bxJnwL9V2bRKv9w4cpIp75yxGeZRaVKoMQnsEg==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -264,13 +264,13 @@
} }
], ],
"engines": { "engines": {
"node": "^14 || ^16 || >=18" "node": ">=18"
} }
}, },
"node_modules/@csstools/media-query-list-parser": { "node_modules/@csstools/media-query-list-parser": {
"version": "2.1.13", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.13.tgz", "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-3.0.0.tgz",
"integrity": "sha512-XaHr+16KRU9Gf8XLi3q8kDlI18d5vzKSKCY510Vrtc9iNR0NJzbY9hhTmwhzYZj/ZwGL4VmB3TA9hJW0Um2qFA==", "integrity": "sha512-W0JlkUFwXjo703wt06AcaWuUcS+6x6IEDyxV6W65Sw+vLCYp+uPsrps+PXTiIfN0V1Pqj5snPzN7EYLmbz1zjg==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -283,17 +283,17 @@
} }
], ],
"engines": { "engines": {
"node": "^14 || ^16 || >=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"@csstools/css-parser-algorithms": "^2.7.1", "@csstools/css-parser-algorithms": "^3.0.0",
"@csstools/css-tokenizer": "^2.4.1" "@csstools/css-tokenizer": "^3.0.0"
} }
}, },
"node_modules/@csstools/selector-specificity": { "node_modules/@csstools/selector-specificity": {
"version": "3.1.1", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.1.1.tgz", "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-4.0.0.tgz",
"integrity": "sha512-a7cxGcJ2wIlMFLlh8z2ONm+715QkPHiyJcxwQlKOz/03GPw1COpfhcmC9wm4xlZfp//jWHNNMwzjtqHXVWU9KA==", "integrity": "sha512-189nelqtPd8++phaHNwYovKZI0FOzH1vQEE3QhHHkNIGrg5fSs9CbYP3RvfEH5geztnIA9Jwq91wyOIwAW5JIQ==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -306,10 +306,10 @@
} }
], ],
"engines": { "engines": {
"node": "^14 || ^16 || >=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"postcss-selector-parser": "^6.0.13" "postcss-selector-parser": "^6.1.0"
} }
}, },
"node_modules/@dual-bundle/import-meta-resolve": { "node_modules/@dual-bundle/import-meta-resolve": {
@@ -3362,9 +3362,9 @@
] ]
}, },
"node_modules/ignore": { "node_modules/ignore": {
"version": "5.3.1", "version": "5.3.2",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
"integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 4" "node": ">= 4"
@@ -4852,9 +4852,9 @@
} }
}, },
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.4.40", "version": "8.4.41",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz",
"integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==",
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
@@ -5379,9 +5379,9 @@
} }
}, },
"node_modules/postcss-resolve-nested-selector": { "node_modules/postcss-resolve-nested-selector": {
"version": "0.1.4", "version": "0.1.6",
"resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.4.tgz", "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz",
"integrity": "sha512-R6vHqZWgVnTAPq0C+xjyHfEZqfIYboCBVSy24MjxEDm+tIh1BU4O6o7DP7AA7kHzf136d+Qc5duI4tlpHjixDw==", "integrity": "sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==",
"dev": true "dev": true
}, },
"node_modules/postcss-safe-parser": { "node_modules/postcss-safe-parser": {
@@ -5437,9 +5437,9 @@
} }
}, },
"node_modules/postcss-selector-parser": { "node_modules/postcss-selector-parser": {
"version": "6.1.1", "version": "6.1.2",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.1.tgz", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz",
"integrity": "sha512-b4dlw/9V8A71rLIDsSwVmak9z2DuBUB7CA1/wSdelNEzqsjoSPeADTWNO09lpH49Diy3/JIZ2bSPB1dI3LJCHg==", "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==",
"dependencies": { "dependencies": {
"cssesc": "^3.0.0", "cssesc": "^3.0.0",
"util-deprecate": "^1.0.2" "util-deprecate": "^1.0.2"
@@ -6556,9 +6556,9 @@
} }
}, },
"node_modules/stylelint": { "node_modules/stylelint": {
"version": "16.8.1", "version": "16.8.2",
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.8.1.tgz", "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.8.2.tgz",
"integrity": "sha512-O8aDyfdODSDNz/B3gW2HQ+8kv8pfhSu7ZR7xskQ93+vI6FhKKGUJMQ03Ydu+w3OvXXE0/u4hWU4hCPNOyld+OA==", "integrity": "sha512-fInKATippQhcSm7AB+T32GpI+626yohrg33GkFT/5jzliUw5qhlwZq2UQQwgl3HsHrf09oeARi0ZwgY/UWEv9A==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -6571,10 +6571,10 @@
} }
], ],
"dependencies": { "dependencies": {
"@csstools/css-parser-algorithms": "^2.7.1", "@csstools/css-parser-algorithms": "^3.0.0",
"@csstools/css-tokenizer": "^2.4.1", "@csstools/css-tokenizer": "^3.0.0",
"@csstools/media-query-list-parser": "^2.1.13", "@csstools/media-query-list-parser": "^3.0.0",
"@csstools/selector-specificity": "^3.1.1", "@csstools/selector-specificity": "^4.0.0",
"@dual-bundle/import-meta-resolve": "^4.1.0", "@dual-bundle/import-meta-resolve": "^4.1.0",
"balanced-match": "^2.0.0", "balanced-match": "^2.0.0",
"colord": "^2.9.3", "colord": "^2.9.3",
@@ -6589,7 +6589,7 @@
"globby": "^11.1.0", "globby": "^11.1.0",
"globjoin": "^0.1.4", "globjoin": "^0.1.4",
"html-tags": "^3.3.1", "html-tags": "^3.3.1",
"ignore": "^5.3.1", "ignore": "^5.3.2",
"imurmurhash": "^0.1.4", "imurmurhash": "^0.1.4",
"is-plain-object": "^5.0.0", "is-plain-object": "^5.0.0",
"known-css-properties": "^0.34.0", "known-css-properties": "^0.34.0",
@@ -6598,10 +6598,10 @@
"micromatch": "^4.0.7", "micromatch": "^4.0.7",
"normalize-path": "^3.0.0", "normalize-path": "^3.0.0",
"picocolors": "^1.0.1", "picocolors": "^1.0.1",
"postcss": "^8.4.40", "postcss": "^8.4.41",
"postcss-resolve-nested-selector": "^0.1.4", "postcss-resolve-nested-selector": "^0.1.6",
"postcss-safe-parser": "^7.0.0", "postcss-safe-parser": "^7.0.0",
"postcss-selector-parser": "^6.1.1", "postcss-selector-parser": "^6.1.2",
"postcss-value-parser": "^4.2.0", "postcss-value-parser": "^4.2.0",
"resolve-from": "^5.0.0", "resolve-from": "^5.0.0",
"string-width": "^4.2.3", "string-width": "^4.2.3",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.26.0", "version": "0.26.3",
"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",
@@ -88,7 +88,7 @@
"replace-in-files-cli": "^3.0.0", "replace-in-files-cli": "^3.0.0",
"rimraf": "^6.0.1", "rimraf": "^6.0.1",
"shx": "^0.3.4", "shx": "^0.3.4",
"stylelint": "^16.8.1", "stylelint": "^16.8.2",
"stylelint-config-standard-scss": "^13.1.0" "stylelint-config-standard-scss": "^13.1.0"
}, },
"optionalDependencies": { "optionalDependencies": {