mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-07 01:54:23 +00:00
Compare commits
27 Commits
v1.0.0-alp
...
v1.0.0-alp
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4e6aad33d6 | ||
![]() |
8c3989e4f1 | ||
![]() |
42a81bab5f | ||
![]() |
559f7be37f | ||
![]() |
a51e0c81c0 | ||
![]() |
463a6b229c | ||
![]() |
60302a7d36 | ||
![]() |
31395afee3 | ||
![]() |
40d16ebab9 | ||
![]() |
5aa08d45f2 | ||
![]() |
2a05087eab | ||
![]() |
24ae3d3ca1 | ||
![]() |
6b250b8d4c | ||
![]() |
90f8f91e61 | ||
![]() |
cc0d83189d | ||
![]() |
4d4db9e870 | ||
![]() |
58cfcc9131 | ||
![]() |
362aae875e | ||
![]() |
3f3a7c21e3 | ||
![]() |
dddb881628 | ||
![]() |
1a0b2f5632 | ||
![]() |
b25de1eb02 | ||
![]() |
0a0315e531 | ||
![]() |
9a1a1405fe | ||
![]() |
f7bda6236e | ||
![]() |
c8c5384bd3 | ||
![]() |
4d4d5ad9bd |
@@ -9,7 +9,8 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "component-library/components/about/about.hugo.html"
|
||||
"msg" " Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
)}}
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "component-library/components/articles/articles.hugo.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,9 +9,10 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "component-library/components/faq/faq.hugo.html"
|
||||
"msg" "Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ end }}
|
||||
|
||||
|
@@ -9,7 +9,8 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "component-library/components/hero/hero.hugo.html"
|
||||
"msg" " Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
)}}
|
||||
|
@@ -9,7 +9,8 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "component-library/components/releases/releases.hugo.html"
|
||||
"msg" " Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
)}}
|
||||
|
@@ -8,7 +8,8 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "component-library/components/separator/separator.hugo.html"
|
||||
"msg" " Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
)}}
|
||||
|
@@ -9,7 +9,8 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "component-library/components/video-message/video-message.hugo.html"
|
||||
"msg" " Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
)}}
|
||||
|
@@ -2,6 +2,9 @@ comment: >-
|
||||
Generates a markdown table of structured arguments. The argument definitions are
|
||||
expected to be defined in a data file identified by a provided structure name.
|
||||
arguments:
|
||||
page:
|
||||
optional: false
|
||||
group: partial
|
||||
structure:
|
||||
type: string
|
||||
position: 0
|
||||
@@ -26,3 +29,28 @@ arguments:
|
||||
comment: >-
|
||||
Flag to filter only arguments that have a parent attribute (either
|
||||
`cascade` or `merge`).
|
||||
render-type:
|
||||
type: select
|
||||
position: 3
|
||||
default: both
|
||||
optional: true
|
||||
comment: >-
|
||||
Option whether to render arguments, user-defined types, or both. Please
|
||||
note that the arguments will render a link to a user-defined type in any
|
||||
case.
|
||||
options:
|
||||
values:
|
||||
- arguments
|
||||
- types
|
||||
- both
|
||||
release: v1.0.0
|
||||
header-level:
|
||||
type: int
|
||||
default: 3
|
||||
optional: true
|
||||
options:
|
||||
min: 1
|
||||
max: 6
|
||||
comment: >-
|
||||
The header level to use for the user-defined type headers.
|
||||
release: v1.0.0
|
||||
|
@@ -65,6 +65,7 @@ arguments:
|
||||
release: v1.0.0
|
||||
link-type:
|
||||
hook:
|
||||
default: assets/image.html
|
||||
group: partial
|
||||
sizes:
|
||||
group: partial
|
||||
|
@@ -1,6 +1,7 @@
|
||||
comment: Adds a keyboard input element.
|
||||
arguments:
|
||||
text:
|
||||
optional: true
|
||||
position: 0
|
||||
release: v1.0.0
|
||||
class:
|
||||
|
@@ -1,6 +1,8 @@
|
||||
comment: >-
|
||||
Defines an individual item.
|
||||
arguments:
|
||||
page:
|
||||
group: partial
|
||||
id:
|
||||
group: partial
|
||||
parent-id:
|
||||
|
@@ -33,6 +33,7 @@ content_blocks:
|
||||
sort: date
|
||||
keywords: featured
|
||||
hide-empty: false
|
||||
header-style: none
|
||||
more:
|
||||
title: More Posts
|
||||
padding: 0
|
||||
|
@@ -21,7 +21,7 @@ As an example, the following shortcode displays the full text of an abbreviation
|
||||
|
||||
<!-- markdownlint-disable MD037 -->
|
||||
{{< example lang="hugo" >}}
|
||||
{{</* abbr key="CI/CD" */>}}
|
||||
{{</* abbr "CI/CD" */>}}
|
||||
{{< /example >}}
|
||||
<!-- markdownlint-enable MD037 -->
|
||||
|
||||
@@ -33,8 +33,9 @@ As an example, the following shortcode displays an accordion with three elements
|
||||
{{< example lang="hugo" >}}
|
||||
{{</* accordion */>}}
|
||||
{{</* accordion-item title="Accordion Item #1" show="true" */>}}
|
||||
This is the first item's accordion body. It supports HTML content, if enabled in the goldmark
|
||||
renderer. The item is shown by adding the value `show` to the `class` argument.
|
||||
This is the first item's accordion body.
|
||||
It supports Markdown content. The item
|
||||
is shown by adding the value `show` to the `class` argument.
|
||||
{{</* /accordion-item */>}}
|
||||
{{</* accordion-item title="Accordion Item #2" */>}}
|
||||
This is the second item's accordion body.
|
||||
@@ -352,8 +353,8 @@ As an example, the following shortcode displays a tab group with vertically alig
|
||||
{{< example lang="hugo" >}}
|
||||
{{</* nav tab-type="pills" vertical="true" */>}}
|
||||
{{</* nav-item title="Nav Item #1" show="true" */>}}
|
||||
This is the first item's nav body. It supports HTML content, if enabled in the goldmark
|
||||
renderer. The item is shown by adding the value `show` to the `class` argument.
|
||||
This is the first item's nav body. It supports Markdown content.
|
||||
The item is shown by adding the value `show` to the `class` argument.
|
||||
{{</* /nav-item */>}}
|
||||
{{</* nav-item title="Nav Item #2" */>}}
|
||||
This is the second item's nav body.
|
||||
|
@@ -557,6 +557,7 @@
|
||||
"animatie",
|
||||
"animation",
|
||||
"arguments",
|
||||
"background-type",
|
||||
"badge",
|
||||
"barre-de-navigation",
|
||||
"block-diagram",
|
||||
@@ -602,21 +603,11 @@
|
||||
"fab-medium",
|
||||
"fab-whatsapp",
|
||||
"fab-x-twitter",
|
||||
"faq-184f299e274a5ce56b6a879ad10e2b73",
|
||||
"faq-184f299e274a5ce56b6a879ad10e2b73-heading-faq-184f299e274a5ce56b6a879ad10e2b73",
|
||||
"faq-184f299e274a5ce56b6a879ad10e2b73-item-0",
|
||||
"faq-184f299e274a5ce56b6a879ad10e2b73-item-1",
|
||||
"faq-184f299e274a5ce56b6a879ad10e2b73-item-2",
|
||||
"faq-43ab418abcc6ab8991ad130c40cca21e",
|
||||
"faq-43ab418abcc6ab8991ad130c40cca21e-heading-faq-43ab418abcc6ab8991ad130c40cca21e",
|
||||
"faq-43ab418abcc6ab8991ad130c40cca21e-item-0",
|
||||
"faq-43ab418abcc6ab8991ad130c40cca21e-item-1",
|
||||
"faq-43ab418abcc6ab8991ad130c40cca21e-item-2",
|
||||
"faq-5f13c156f93854db8bafbe22d85efd03",
|
||||
"faq-5f13c156f93854db8bafbe22d85efd03-heading-faq-5f13c156f93854db8bafbe22d85efd03",
|
||||
"faq-5f13c156f93854db8bafbe22d85efd03-item-0",
|
||||
"faq-5f13c156f93854db8bafbe22d85efd03-item-1",
|
||||
"faq-5f13c156f93854db8bafbe22d85efd03-item-2",
|
||||
"faq-d60f86697e8e822c14f81bde047a063e",
|
||||
"faq-d60f86697e8e822c14f81bde047a063e-heading-faq-d60f86697e8e822c14f81bde047a063e",
|
||||
"faq-d60f86697e8e822c14f81bde047a063e-item-0",
|
||||
"faq-d60f86697e8e822c14f81bde047a063e-item-1",
|
||||
"faq-d60f86697e8e822c14f81bde047a063e-item-2",
|
||||
"fas-1",
|
||||
"fas-2",
|
||||
"fas-3",
|
||||
|
4
go.mod
4
go.mod
@@ -8,7 +8,6 @@ require (
|
||||
github.com/gethinode/mod-bootstrap v1.3.3 // indirect
|
||||
github.com/gethinode/mod-csp v1.0.7 // indirect
|
||||
github.com/gethinode/mod-flexsearch/v2 v2.1.1 // indirect
|
||||
github.com/gethinode/mod-fontawesome v1.10.1 // indirect
|
||||
github.com/gethinode/mod-fontawesome/v2 v2.0.0 // indirect
|
||||
github.com/gethinode/mod-google-analytics v1.3.1 // indirect
|
||||
github.com/gethinode/mod-katex v1.1.3 // indirect
|
||||
@@ -16,8 +15,7 @@ require (
|
||||
github.com/gethinode/mod-lottie v1.5.14 // indirect
|
||||
github.com/gethinode/mod-mermaid v1.1.23 // indirect
|
||||
github.com/gethinode/mod-simple-datatables v1.1.7 // indirect
|
||||
github.com/gethinode/mod-utils/v2 v2.10.0 // indirect
|
||||
github.com/gethinode/mod-utils/v3 v3.1.2 // indirect
|
||||
github.com/gethinode/mod-utils/v3 v3.3.1 // indirect
|
||||
github.com/nextapps-de/flexsearch v0.0.0-20250606060143-c28f52c09b7a // indirect
|
||||
github.com/twbs/bootstrap v5.3.6+incompatible // indirect
|
||||
)
|
||||
|
8
go.sum
8
go.sum
@@ -412,6 +412,14 @@ github.com/gethinode/mod-utils/v3 v3.1.1 h1:hjC/vnq7NF2Kf18qkpeTHiS14bVrNa55avy0
|
||||
github.com/gethinode/mod-utils/v3 v3.1.1/go.mod h1:9iHYWiDpDlcyrGAOHniubK/kziJYhTsw7UpGM+u4MOM=
|
||||
github.com/gethinode/mod-utils/v3 v3.1.2 h1:nE1tUkeSTOPxaLRoSiQlODbJhekOJsHrKXte5A2jujg=
|
||||
github.com/gethinode/mod-utils/v3 v3.1.2/go.mod h1:9iHYWiDpDlcyrGAOHniubK/kziJYhTsw7UpGM+u4MOM=
|
||||
github.com/gethinode/mod-utils/v3 v3.1.3 h1:oIpbIUCpVrWb7Axo1TZODWJ2iA6uYZp4rpx8fC7GIXk=
|
||||
github.com/gethinode/mod-utils/v3 v3.1.3/go.mod h1:9iHYWiDpDlcyrGAOHniubK/kziJYhTsw7UpGM+u4MOM=
|
||||
github.com/gethinode/mod-utils/v3 v3.2.0 h1:FmRCMAqNvKeQSY+rTy+9lZ65JKkuDA9MTw/HW/HWzSM=
|
||||
github.com/gethinode/mod-utils/v3 v3.2.0/go.mod h1:9iHYWiDpDlcyrGAOHniubK/kziJYhTsw7UpGM+u4MOM=
|
||||
github.com/gethinode/mod-utils/v3 v3.3.0 h1:qxuIavgL9LIyMhfCv8El+KL41rcNmQ8GaExn142QmLw=
|
||||
github.com/gethinode/mod-utils/v3 v3.3.0/go.mod h1:9iHYWiDpDlcyrGAOHniubK/kziJYhTsw7UpGM+u4MOM=
|
||||
github.com/gethinode/mod-utils/v3 v3.3.1 h1:0mHrUyIwSkbiQIUuXpnptYDIizkI7Ak39RTgoRMbJfY=
|
||||
github.com/gethinode/mod-utils/v3 v3.3.1/go.mod h1:9iHYWiDpDlcyrGAOHniubK/kziJYhTsw7UpGM+u4MOM=
|
||||
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-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg=
|
||||
|
@@ -24,6 +24,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/adapter/cloudinary.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/adapter/hugo.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/adapter/imagekit-rewrite.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -24,6 +24,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/adapter/imagekit.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -22,6 +22,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/adapter/imgix.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
132
layouts/_partials/assets/args.html
Normal file
132
layouts/_partials/assets/args.html
Normal file
@@ -0,0 +1,132 @@
|
||||
{{/*
|
||||
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.
|
||||
*/}}
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
{{ define "_partials/inline/args-table.html"}}
|
||||
{{ $args := .args }}
|
||||
{{ $types := .types }}
|
||||
{{ $page := .page }}
|
||||
{{ $group := .group | default "" }}
|
||||
{{ $parent := .parent }}
|
||||
{{ $reflect := "" }}
|
||||
|
||||
{{ $table := printf "| %s | %s | %s | %s | %s |\n| --- | --- | --- | --- | --- |"
|
||||
(T "name") (T "type") (T "required") (T "default") (T "comment")
|
||||
}}
|
||||
|
||||
{{ range $key, $val := $args }}
|
||||
{{ if eq $key "_reflect" }}
|
||||
{{ $reflect = $val }}
|
||||
{{ continue }}
|
||||
{{ end }}
|
||||
{{ $skip := false }}
|
||||
{{ $groups := slice }}
|
||||
{{ if $val }} {{ $groups = $groups | append $val.group }}{{ end }}
|
||||
{{ if and $group $val.group }}
|
||||
{{ $skip = not (in $groups $group )}}
|
||||
{{ end }}
|
||||
{{ if $parent }}{{ $skip = not (in (slice "cascade" "merge") $val.parent) }}{{ end }}
|
||||
|
||||
{{ if not $skip }}
|
||||
{{ $type := $val.type }}
|
||||
{{ $udt := false }}
|
||||
{{ $slice := false }}
|
||||
{{ if reflect.IsSlice $val.type }}{{ $type = delimit $val.type ", " }}{{ end }}
|
||||
{{ with index $types $val.type }}
|
||||
{{ $udt = true }}
|
||||
{{ $slice = eq ._reflect "[]interface {}" }}
|
||||
{{ end }}
|
||||
{{ $required := "" }}
|
||||
{{ if not $val.optional }}{{ $required = "yes" }}{{ end }}
|
||||
|
||||
{{ $comment := $val.comment }}
|
||||
{{ if $val.deprecated }}
|
||||
{{ $btn := printf `{{< release version="%s" short="true" button-size="sm" inline="true" release-state="deprecated" >}}` $val.deprecated }}
|
||||
{{ with $val.alternative }}
|
||||
{{ $comment = printf "%s **%s**. %s" $btn (T "alternativeFeature" .) $comment }}
|
||||
{{ else }}
|
||||
{{ $comment = printf "%s %s" $btn $comment }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $val.release }}
|
||||
{{ $comment = printf `{{< release version="%s" short="true" button-size="sm" inline="true" >}} %s` $val.release $comment }}
|
||||
{{ end }}
|
||||
|
||||
{{ $min := "" }}
|
||||
{{ $max := "" }}
|
||||
{{ if and $val.options.values (eq $type "select") }}
|
||||
{{ $comment = printf "%s %s: [`%s`]." $comment (T "supportedValues") (delimit $val.options.values "`, `") }}
|
||||
{{ else if in (slice "int" "float" "float64") $type }}
|
||||
{{ if eq (printf "%T" $val.options.min) "int" }}{{ $min = int $val.options.min }}{{ end }}
|
||||
{{ if eq (printf "%T" $val.options.max) "int" }}{{ $max = int $val.options.max }}{{ end }}
|
||||
{{ end }}
|
||||
{{ if and (eq (printf "%T" $min) "int") (eq (printf "%T" $max) "int") }}
|
||||
{{ $comment = printf "%s %s: [`%d - %d`]." $comment (T "supportedValues") $min $max }}
|
||||
{{ else if (eq (printf "%T" $min) "int") }}
|
||||
{{ $comment = printf "%s %s: `>=%d`." $comment (T "supportedValues") $min }}
|
||||
{{ else if (eq (printf "%T" $max) "int") }}
|
||||
{{ $comment = printf "%s %s: `<=%d`." $comment (T "supportedValues") $max }}
|
||||
{{ end }}
|
||||
|
||||
{{ $default := "" }}
|
||||
{{ with $val.default }}{{ $default = printf "`%v`" . }}{{ end }}
|
||||
{{ if $udt }}{{ $type = printf "[%s](#%s)" $type (anchorize (printf "%s %s" $type (T "type"))) }}{{ end }}
|
||||
{{ if $slice }}{{ $type = printf "[]%s" $type }}{{ end }}
|
||||
{{ $table = printf "%s\n| %s | %s | %s | %s | %s |" $table $key $type $required $default $comment }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return partial "assets/table.html" (dict "page" $page "input" $table "wrap" true) }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Initialize arguments */}}
|
||||
{{- $args := partial "utilities/InitArgs.html" (dict "structure" "args" "args" . "group" "partial") -}}
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/args.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
) -}}
|
||||
{{- $error = $args.err -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Initialize type structure */}}
|
||||
{{ $structure := $args.structure }}
|
||||
{{ $bookshop := "" }}
|
||||
{{ if hasPrefix $structure "bookshop-" }}{{ $bookshop = strings.TrimPrefix "bookshop-" $structure }}{{ $structure = "" }}{{ end }}
|
||||
{{ $types := dict }}
|
||||
{{ if not $error }}
|
||||
{{ $types = partial "utilities/InitTypes.html" (dict "structure" $structure "bookshop" $bookshop) }}
|
||||
{{ if or $types.err $types.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/args.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($types.errmsg | append $types.warnmsg)
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ $error = $args.err }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Main code */}}
|
||||
{{ if not $error }}
|
||||
{{ $params := dict "types" $types.udt "page" $args.page "group" $args.group "parent" $args.parent }}
|
||||
{{ if in (slice "arguments" "both") $args.renderType }}
|
||||
{{ partial "inline/args-table.html" (merge $params (dict "args" $types.types)) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if in (slice "types" "both") $args.renderType }}
|
||||
{{ $prefix := strings.Repeat $args.headerLevel "#" }}
|
||||
{{ range $k, $v := $types.udt }}
|
||||
{{ printf "%s %s %s" $prefix $k (T "type") | $args.page.RenderString }}
|
||||
{{ partial "inline/args-table.html" (merge $params (dict "args" $v)) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
@@ -21,6 +21,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/breadcrumb.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,9 +11,10 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/button.html"
|
||||
"msg" "Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ $error = $args.err }}
|
||||
{{ end }}
|
||||
|
@@ -21,9 +21,10 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/card-group.html"
|
||||
"msg" "Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"file" page.File
|
||||
)}}
|
||||
{{- $error = $args.err -}}
|
||||
{{- end -}}
|
||||
|
@@ -67,9 +67,10 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/card.html"
|
||||
"msg" "Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ $error = $args.err }}
|
||||
{{ end }}
|
||||
|
@@ -9,9 +9,10 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/carousel-item.html"
|
||||
"msg" "Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ end }}
|
||||
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/download.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/featured-illustration.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/helpers/get-dimension.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/helpers/image-definition.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/helpers/image-dimension.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/helpers/image-rewrite.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/helpers/image-set.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/hero-image.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/hero.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/image.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
@@ -61,7 +62,7 @@
|
||||
|
||||
{{- range $suffix := $modes -}}
|
||||
{{- $image := printf "%s-%s%s" $base $suffix $ext -}}
|
||||
{{- $params = merge $params (dict "src" $image "color-mode" $suffix "modes" $modes) -}}
|
||||
{{- $params = merge $params (dict "src" $image) -}}
|
||||
{{- partial "assets/helpers/image-definition.html" $params -}}
|
||||
{{- end -}}
|
||||
{{ else }}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/link.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/links.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/live-image.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -7,6 +7,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/live-pages.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -10,6 +10,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/nav-item.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
@@ -71,7 +72,7 @@
|
||||
aria-labelledby="{{ $parentID }}-heading-{{ $args.id }}"
|
||||
data-bs-parent="#accordion-{{ $parentID }}"
|
||||
>
|
||||
<div class="accordion-body">{{- $args.body | safeHTML -}}</div>
|
||||
<div class="accordion-body">{{ $args.body | $args.page.RenderString | safeHTML }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
@@ -86,7 +87,7 @@
|
||||
data-has-content="{{ gt (len $args.body) 0 }}"
|
||||
{{ if $args.disabled }} data-disabled-id="{{ $args.id }}"{{ end }}
|
||||
>
|
||||
{{ $args.body }}
|
||||
{{ $args.body | $args.page.RenderString | safeHTML }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
@@ -11,6 +11,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/nav.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
@@ -32,7 +33,8 @@
|
||||
<div class="d-lg-none">
|
||||
<div id="accordion-{{ $id }}" class="accordion mb-3{{ with $args.class }} {{ . }}{{ end }} nav-callout">
|
||||
{{- range $index, $item := $args.list -}}
|
||||
{{ partial "assets/nav-item.html" (dict
|
||||
{{ partial "assets/nav-item.html" (dict
|
||||
"page" $args.page
|
||||
"id" $index
|
||||
"parentID" $id
|
||||
"fade" false
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/navbar-item.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -72,6 +72,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/navbar.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/page-alert.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -165,6 +165,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/pagination.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/persona.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -7,6 +7,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/section-title.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/sharing.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/sidebar.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/stack.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -28,6 +28,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/table.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -13,6 +13,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/timeline.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/toast.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/toc.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/toc.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -24,6 +24,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "assets/video.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
@@ -32,7 +33,8 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Initialize local arguments */}}
|
||||
{{- $provider := or $args.provider $args.host }}
|
||||
{{- $title := $args.title -}}
|
||||
{{- $provider := or $args.host $args.provider }}
|
||||
{{- $account := $args.account }}
|
||||
{{ if not $account }}
|
||||
{{ with index $args.page.Site.Params.videos $provider }}
|
||||
@@ -148,7 +150,6 @@
|
||||
{{ $width := index $metadata "width" }}
|
||||
{{ if and $height $width }}
|
||||
{{ $padding := printf "%.2f%%" (mul (div (float $height) $width) 100) }}
|
||||
{{ $title := $args.title }}
|
||||
{{ if not $title }}{{ $title = printf "Cloudinary video '%s'" (path.BaseName $id) }}{{ end }}
|
||||
|
||||
<div class="video-embedded {{ $args.class }}" data-video-padding="{{ $padding }}">
|
||||
|
@@ -5,7 +5,12 @@
|
||||
{{ cond (gt (len .Site.Copyright) 0) .Site.Copyright $copyright }}
|
||||
{{ .Site.Params.footer.license | safeHTML }} |
|
||||
{{ if .Site.Params.main.endorse }}
|
||||
{{ $link := partial "assets/link.html" (dict "destination" (index site.Params.links "hinode") "text" "Hinode" "class" "link-bg-footer" "page" .Page) }}
|
||||
{{ $link := partial "assets/link.html" (dict
|
||||
"href" (index site.Params.links "hinode")
|
||||
"text" "Hinode"
|
||||
"class" "link-bg-footer"
|
||||
"page" .Page
|
||||
) }}
|
||||
{{ T "poweredBy" $link | safeHTML }}
|
||||
{{ end }}
|
||||
</small>
|
||||
|
@@ -5,22 +5,26 @@
|
||||
*/}}
|
||||
|
||||
{{/* Initialize arguments */}}
|
||||
{{ $args := partial "utilities/InitArgs.html" (dict "structure" "script" "args" .) }}
|
||||
{{ if $args.err }}
|
||||
{{ partial "utilities/LogErr.html" (dict
|
||||
{{- $args := partial "utilities/InitArgs.html" (dict "structure" "script" "args" .) -}}
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "templates/script.html"
|
||||
"msg" "Invalid arguments"
|
||||
"details" $args.errmsg
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ end }}
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
) -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{/* Initialize local arguments */}}
|
||||
{{ $category := cond (ne $args.category "other") $args.category "" }}
|
||||
{{- $category := cond (ne $args.category "other") $args.category "" -}}
|
||||
|
||||
{{/* Main code */}}
|
||||
<script src="{{ $args.link }}"
|
||||
{{- with $category }} data-category="{{ . }}"{{ end -}}
|
||||
{{- with $args.integrity }}integrity="{{ . }}" crossorigin="anonymous"{{ end }}
|
||||
{{- with $args.state }} {{ . | safeHTMLAttr }}{{ end -}}>
|
||||
</script>
|
||||
{{- if not $args.err -}}
|
||||
<script src="{{ $args.link }}"
|
||||
{{- with $category }} data-category="{{ . }}"{{ end -}}
|
||||
{{- with $args.integrity }}integrity="{{ . }}" crossorigin="anonymous"{{ end }}
|
||||
{{- with $args.state }} {{ . | safeHTMLAttr }}{{ end -}}>
|
||||
</script>
|
||||
{{- end -}}
|
@@ -7,6 +7,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "utilities/GetBackgroundStyle.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -12,9 +12,10 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "utilities/GetLink.html"
|
||||
"msg" "Invalid arguments"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ $error = $args.err }}
|
||||
{{ end }}
|
||||
|
@@ -1,114 +0,0 @@
|
||||
<!--
|
||||
Copyright © 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.
|
||||
-->
|
||||
|
||||
{{/* Inline partial to retrieve the type definition of the provided key (without recursion) */}}
|
||||
{{ define "_partials/inline/type-definition.html" }}
|
||||
{{ $key := .key }}
|
||||
{{ $references := .references }}
|
||||
{{ $types := .types }}
|
||||
|
||||
{{ $def := index $references $key }}
|
||||
{{ $udt := "" }}
|
||||
{{ $reflect := "" }}
|
||||
{{ $reserved := slice "bool" "int" "int64" "float" "float64" "string" "dict" "slice" }}
|
||||
{{ if and $def (not (reflect.IsSlice $def.type)) (not (in $reserved $def.type)) }}
|
||||
{{ with index $types $def.type }}
|
||||
<!-- Reduce child elements to slice of argument names -->
|
||||
{{ $args := slice }}
|
||||
{{ $reflect = printf "%T" . }}
|
||||
{{ if reflect.IsMap . }}
|
||||
{{ range $k, $_ := . }}
|
||||
{{ $args = $args | append $k }}
|
||||
{{ end }}
|
||||
{{ else if reflect.IsSlice . }}
|
||||
{{ with index . 0 }}
|
||||
{{ range $k, $_ := . }}
|
||||
{{ $args = $args | append $k }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Retrieve type definition for each argument -->
|
||||
{{ $definitions := dict }}
|
||||
{{ $definitions := merge $definitions (dict "_reflect" $reflect) }}
|
||||
{{ range $args }}
|
||||
{{ $type := partial "inline/type-definition.html" (dict "key" . "references" $references "types" $types) }}
|
||||
{{ if and $type $type.definition }}
|
||||
{{ $definitions = merge $definitions (dict . $type.definition) }}
|
||||
{{ else }}
|
||||
{{- $errorMsg = $errorMsg | append (printf "partial [utilities/InitArgs.html] - Missing type for '%s.%s' in '%s'" $key . ) -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $udt = dict $def.type $definitions }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return (dict "definition" $def "udt" $udt) }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Initalize arguments and local variables */}}
|
||||
{{ $error := false }}
|
||||
{{ $errorMsg := slice }}
|
||||
{{ $warnMsg := slice }}
|
||||
{{ $params := dict }}
|
||||
{{ $definitions := dict }}
|
||||
{{ $udt := dict }}
|
||||
|
||||
{{ $structure := .structure }}
|
||||
{{ $bookshop := .bookshop }}
|
||||
{{ $group := .group }}
|
||||
{{ $child := .child }}
|
||||
|
||||
{{ if and (not $structure) (not $bookshop) }}
|
||||
{{- $errorMsg = $errorMsg | append (printf "partial [utilities/InitTypes.html] - Missing value for param 'structure' or 'bookshop'") -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ if not $error }}
|
||||
{{ $args := dict }}
|
||||
{{ $references := index (index site.Data.structures "_arguments") "arguments" }}
|
||||
{{ $types := index (index site.Data.structures "_types") "types" }}
|
||||
|
||||
{{/* Initalize the regular or bookshop argument structure */}}
|
||||
{{ if $structure }}
|
||||
{{ $args = (index site.Data.structures $structure).arguments | default dict }}
|
||||
{{ else }}
|
||||
{{ $args = index (index (index site.Data.structures.components $bookshop) (printf "%s.bookshop" $bookshop)) "blueprint" | default dict }}
|
||||
{{ $args = merge $args (dict "_bookshop_name" nil) }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Merge any child arguments */}}
|
||||
{{ if $child }}
|
||||
{{ $extra_def := (index site.Data.structures $child).arguments }}
|
||||
{{ if not $extra_def }}
|
||||
{{- $errorMsg = $errorMsg | append (printf "partial [utilities/InitTypes.html] - Missing definitions: %s" $child) -}}
|
||||
{{ $error = true }}
|
||||
{{ else }}
|
||||
{{ range $key, $val := $extra_def }}
|
||||
{{ if and $val $val.parent }}{{ $args = merge (dict $key $val) $args }}{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Initialize the arguments and their type definitions recursively */}}
|
||||
{{ range $key, $v := $args }}
|
||||
{{ $type := partial "inline/type-definition.html" (dict "key" $key "args" $args "references" $references "types" $types) }}
|
||||
{{ if and $type $type.definition }}
|
||||
{{ $definitions = merge $definitions (dict $key $type.definition) }}
|
||||
{{ with $type.udt }}
|
||||
{{ $udt = merge $udt . }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{- $errorMsg = $errorMsg | append (printf "partial [utilities/InitArgs.html] - Missing type for '%s' in '%s'" $key (or $structure $bookshop) ) -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $params = merge $params (dict "types" $definitions "udt" $udt "err" $error "errmsg" $errorMsg "warnmsg" $warnMsg) }}
|
||||
{{ return $params }}
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/abbr.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/accordion-item.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/accordion.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/alert.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -4,124 +4,30 @@
|
||||
Visit gethinode.com/license for more details.
|
||||
*/}}
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
{{ define "_partials/inline/args-table.html"}}
|
||||
{{ $args := .args }}
|
||||
{{ $types := .types }}
|
||||
{{ $page := .page }}
|
||||
{{ $group := .group | default "" }}
|
||||
{{ $parent := .parent }}
|
||||
{{ $reflect := "" }}
|
||||
|
||||
{{ $table := printf "| %s | %s | %s | %s | %s |\n| --- | --- | --- | --- | --- |"
|
||||
(T "name") (T "type") (T "required") (T "default") (T "comment")
|
||||
}}
|
||||
|
||||
{{ range $key, $val := $args }}
|
||||
{{ if eq $key "_reflect" }}
|
||||
{{ $reflect = $val }}
|
||||
{{ continue }}
|
||||
{{ end }}
|
||||
{{ $skip := false }}
|
||||
{{ $groups := slice }}
|
||||
{{ if $val }} {{ $groups = $groups | append $val.group }}{{ end }}
|
||||
{{ if and $group $val.group }}
|
||||
{{ $skip = not (in $groups $group )}}
|
||||
{{ end }}
|
||||
{{ if $parent }}{{ $skip = not (in (slice "cascade" "merge") $val.parent) }}{{ end }}
|
||||
|
||||
{{ if not $skip }}
|
||||
{{ $type := $val.type }}
|
||||
{{ $udt := false }}
|
||||
{{ $slice := false }}
|
||||
{{ if reflect.IsSlice $val.type }}{{ $type = delimit $val.type ", " }}{{ end }}
|
||||
{{ with index $types $val.type }}
|
||||
{{ $udt = true }}
|
||||
{{ $slice = eq ._reflect "[]interface {}" }}
|
||||
{{ end }}
|
||||
{{ $required := "" }}
|
||||
{{ if not $val.optional }}{{ $required = "yes" }}{{ end }}
|
||||
|
||||
{{ $comment := $val.comment }}
|
||||
{{ if $val.deprecated }}
|
||||
{{ $btn := printf `{{< release version="%s" short="true" button-size="sm" inline="true" release-state="deprecated" >}}` $val.deprecated }}
|
||||
{{ with $val.alternative }}
|
||||
{{ $comment = printf "%s **%s**. %s" $btn (T "alternativeFeature" .) $comment }}
|
||||
{{ else }}
|
||||
{{ $comment = printf "%s %s" $btn $comment }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $val.release }}
|
||||
{{ $comment = printf `{{< release version="%s" short="true" button-size="sm" inline="true" >}} %s` $val.release $comment }}
|
||||
{{ end }}
|
||||
|
||||
{{ $min := "" }}
|
||||
{{ $max := "" }}
|
||||
{{ if and $val.options.values (eq $type "select") }}
|
||||
{{ $comment = printf "%s %s: [`%s`]." $comment (T "supportedValues") (delimit $val.options.values "`, `") }}
|
||||
{{ else if in (slice "int" "float" "float64") $type }}
|
||||
{{ if eq (printf "%T" $val.options.min) "int" }}{{ $min = int $val.options.min }}{{ end }}
|
||||
{{ if eq (printf "%T" $val.options.max) "int" }}{{ $max = int $val.options.max }}{{ end }}
|
||||
{{ end }}
|
||||
{{ if and (eq (printf "%T" $min) "int") (eq (printf "%T" $max) "int") }}
|
||||
{{ $comment = printf "%s %s: [`%d - %d`]." $comment (T "supportedValues") $min $max }}
|
||||
{{ else if (eq (printf "%T" $min) "int") }}
|
||||
{{ $comment = printf "%s %s: `>=%d`." $comment (T "supportedValues") $min }}
|
||||
{{ else if (eq (printf "%T" $max) "int") }}
|
||||
{{ $comment = printf "%s %s: `<=%d`." $comment (T "supportedValues") $max }}
|
||||
{{ end }}
|
||||
|
||||
{{ $default := "" }}
|
||||
{{ with $val.default }}{{ $default = printf "`%v`" . }}{{ end }}
|
||||
{{ if $udt }}{{ $type = printf "[%s](#%s)" $type (anchorize (printf "%s %s" $type (T "type"))) }}{{ end }}
|
||||
{{ if $slice }}{{ $type = printf "[]%s" $type }}{{ end }}
|
||||
{{ $table = printf "%s\n| %s | %s | %s | %s | %s |" $table $key $type $required $default $comment }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return partial "assets/table.html" (dict "page" $page "input" $table "wrap" true) }}
|
||||
{{ end }}
|
||||
{{- $error := false -}}
|
||||
|
||||
{{/* Validate and initialize arguments */}}
|
||||
{{ $args := partial "utilities/InitArgs.html" (dict "structure" "args" "args" .Params "named" .IsNamedParams "group" "shortcode") }}
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
{{- $args := partial "utilities/InitArgs.html" (dict "structure" "args" "args" .Params "named" .IsNamedParams "group" "shortcode") -}}
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/args.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"position" .Position
|
||||
)}}
|
||||
{{ $error = $args.err }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Initialize type structure */}}
|
||||
{{ $structure := $args.structure }}
|
||||
{{ $bookshop := "" }}
|
||||
{{ if hasPrefix $structure "bookshop-" }}{{ $bookshop = strings.TrimPrefix "bookshop-" $structure }}{{ $structure = "" }}{{ end }}
|
||||
{{ $types := dict }}
|
||||
{{ if not $error }}
|
||||
{{ $types = partial "utilities/InitTypes.html" (dict "structure" $structure "bookshop" $bookshop) }}
|
||||
{{ if or $types.err $types.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/args.html"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($types.errmsg | append $types.warnmsg)
|
||||
"file" page.File
|
||||
"position" .Position
|
||||
)}}
|
||||
{{ $error = $args.err }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
) -}}
|
||||
{{- $error = $args.err -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Main code */}}
|
||||
{{ if not $error }}
|
||||
{{ $params := dict "types" $types.udt "page" .Page "group" $args.group "parent" $args.parent }}
|
||||
{{ partial "inline/args-table.html" (merge $params (dict "args" $types.types)) }}
|
||||
|
||||
{{ range $k, $v := $types.udt }}
|
||||
{{ printf "## %s %s" $k (T "type") | $.Page.RenderString }}
|
||||
{{ partial "inline/args-table.html" (merge $params (dict "args" $v)) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- if not $args.err -}}
|
||||
{{- partial "assets/args.html" (dict
|
||||
"page" .Page
|
||||
"structure" $args.structure
|
||||
"group" $args.group
|
||||
"parent" $args.parent
|
||||
"render-type" $args.renderType
|
||||
"header-level" $args.headerLevel
|
||||
) -}}
|
||||
{{- end -}}
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/badge.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/breadcrumb.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/button-group.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/button.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -10,10 +10,11 @@
|
||||
{{ $args := partial "utilities/InitArgs.html" (dict "structure" "card-group" "child" "card" "args" .Params "named" .IsNamedParams) }}
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/card-group.html"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"partial" "shortcodes/card-group.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"position" .Position
|
||||
)}}
|
||||
{{ $error = $args.err }}
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/card.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/carousel.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/collapse.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -15,6 +15,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/command.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -20,6 +20,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/docs.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -21,6 +21,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/example-bookshop.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -18,6 +18,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/example.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -20,6 +20,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/file.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/image.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/carousel-item.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,10 +9,11 @@
|
||||
{{ $args := partial "utilities/InitArgs.html" (dict "structure" "ins" "args" .Params) }}
|
||||
{{ if $args.err }}
|
||||
{{ partial "utilities/LogErr.html" (dict
|
||||
"partial" "shortcodes/ins.html"
|
||||
"msg" "Invalid arguments"
|
||||
"details" $args.errmsg
|
||||
"file" page.File
|
||||
"partial" "shortcodes/ins.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" $args.errmsg
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ end }}
|
||||
|
||||
|
@@ -4,21 +4,38 @@
|
||||
Visit gethinode.com/license for more details.
|
||||
*/}}
|
||||
|
||||
{{- $error := false -}}
|
||||
|
||||
{{/* Initialize arguments */}}
|
||||
{{- $args := partial "utilities/InitArgs.html" (dict "structure" "kbd" "args" .Params "named" .IsNamedParams "group" "shortcode") -}}
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/kbd.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
"position" .Position
|
||||
)}}
|
||||
) -}}
|
||||
{{- $error = $args.err -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Initialize local arguments */}}
|
||||
{{- $text := or $args.text $args.title }}
|
||||
{{- if not $text -}}
|
||||
{{- partial "utilities/LogErr.html" (dict
|
||||
"partial" "shortcodes/kbd.html"
|
||||
"msg" "Invalid arguments"
|
||||
"details" (slice "argument 'text': expected value")
|
||||
"file" page.File
|
||||
"position" .Position
|
||||
) -}}
|
||||
{{- $error = true -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Main code */}}
|
||||
{{- if not $args.error }}
|
||||
{{- if not $error }}
|
||||
<kbd {{ if or $args.color $args.class }}class="{{ with $args.color }}text-bg-{{ . }} {{ end }}{{ $args.class }}"{{ end }}>
|
||||
{{ or $args.text $args.title | plainify }}
|
||||
{{ $text | plainify }}
|
||||
</kbd>
|
||||
{{ end -}}
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/link.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/mark.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/nav-item.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
@@ -29,11 +30,12 @@
|
||||
{{- if isset .Parent.Params "fade" }}{{ $parentFade = partial "utilities/CastBool.html" (.Parent.Get "fade") }}{{ end -}}
|
||||
{{- $fade = or $fade $parentFade -}}
|
||||
{{- $title := or $args.title $args.header -}}
|
||||
{{- $body := trim .Inner " \r\n" | .Page.RenderString -}}
|
||||
{{- $body := trim .Inner " \r\n" -}}
|
||||
{{- $current := "" -}}
|
||||
|
||||
{{/* Main code */}}
|
||||
{{- $output := partial "assets/nav-item.html" (dict
|
||||
"page" .Page
|
||||
"id" $id
|
||||
"parent-id" $parent
|
||||
"fade" $fade
|
||||
@@ -56,6 +58,7 @@
|
||||
{{- end }}
|
||||
|
||||
{{- $alternative := partial "assets/nav-item" (dict
|
||||
"page" .Page
|
||||
"id" $id
|
||||
"parent-id" $parent
|
||||
"fade" $fade
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/nav.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
@@ -20,9 +21,9 @@
|
||||
{{- $innerTitles := .Scratch.Get "inner-title" -}}
|
||||
{{- $input := trim .Inner " \r\n" -}}
|
||||
{{- if $input -}}
|
||||
{{ $input = replace $input "\n" "\n " -}}
|
||||
{{ warnf "Unexpected inner content: %s\r\n %s" .Position $input -}}
|
||||
{{ end }}
|
||||
{{- $input = replace $input "\n" "\n " -}}
|
||||
{{- warnf "Unexpected inner content: %s\r\n %s" .Position $input -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Main code */}}
|
||||
{{- if not $args.err -}}
|
||||
@@ -40,4 +41,4 @@
|
||||
"width" $args.width
|
||||
)
|
||||
-}}
|
||||
{{ end }}
|
||||
{{- end -}}
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/navbar.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/persona.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/release.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/spinner.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -8,6 +8,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/sub.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -8,6 +8,7 @@
|
||||
{{- if or $args.err $args.warnmsg -}}
|
||||
{{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/sup.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/table.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -13,6 +13,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/timeline.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/toast.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -11,6 +11,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/tooltip.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
@@ -9,6 +9,7 @@
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "shortcodes/video.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user