mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-07 18:14:28 +00:00
Compare commits
34 Commits
v1.0.0-alp
...
v1.0.0-alp
Author | SHA1 | Date | |
---|---|---|---|
![]() |
900fce4169 | ||
![]() |
c82f9a41d4 | ||
![]() |
ea83db2eeb | ||
![]() |
d37c2f6517 | ||
![]() |
68a4859638 | ||
![]() |
81494cb1ed | ||
![]() |
8307e2ab57 | ||
![]() |
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 |
@@ -1,6 +1,7 @@
|
||||
@import "modules/bookshop/shared/styles/global";
|
||||
@import "modules/bookshop/components/about/about";
|
||||
@import "modules/bookshop/components/articles/articles";
|
||||
@import "modules/bookshop/components/cards/cards";
|
||||
@import "modules/bookshop/components/faq/faq";
|
||||
@import "modules/bookshop/components/hero/hero";
|
||||
@import "modules/bookshop/components/releases/releases";
|
||||
|
@@ -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
|
||||
|
32
component-library/components/cards/cards.bookshop.yml
Normal file
32
component-library/components/cards/cards.bookshop.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
# Metadata about this component, to be used in the CMS
|
||||
spec:
|
||||
structures:
|
||||
- content_blocks
|
||||
label: Benefits
|
||||
description: Introduction section
|
||||
icon: check
|
||||
tags: []
|
||||
|
||||
# Defines the structure of this component, as well as the default values
|
||||
blueprint:
|
||||
heading:
|
||||
preheading:
|
||||
heading:
|
||||
content:
|
||||
align:
|
||||
width:
|
||||
cols:
|
||||
icon-rounded:
|
||||
padding:
|
||||
background:
|
||||
backdrop:
|
||||
color:
|
||||
subtle:
|
||||
elements:
|
||||
- title:
|
||||
icon:
|
||||
image:
|
||||
mode:
|
||||
content:
|
||||
orientation:
|
||||
class:
|
71
component-library/components/cards/cards.hugo.html
Normal file
71
component-library/components/cards/cards.hugo.html
Normal file
@@ -0,0 +1,71 @@
|
||||
{{/*
|
||||
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.
|
||||
*/}}
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
{{/* Initialize arguments */}}
|
||||
{{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "cards" "args" .)}}
|
||||
{{ if or $args.err $args.warnmsg }}
|
||||
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
|
||||
"partial" "component-library/components/cards/cards.hugo.html"
|
||||
"warnid" "warn-invalid-arguments"
|
||||
"msg" "Invalid arguments"
|
||||
"details" ($args.errmsg | append $args.warnmsg)
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ $error = $args.err }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Initialize local variables */}}
|
||||
{{ $list := slice }}
|
||||
{{ range $args.elements }}
|
||||
<!-- TODO: check mode -->
|
||||
{{ $list = $list | append (dict
|
||||
"title" .title
|
||||
"description" (.content | page.RenderString)
|
||||
"icon" .icon
|
||||
"thumbnail" .image
|
||||
) }}
|
||||
{{ end}}
|
||||
|
||||
{{ if not $error }}
|
||||
<div class="container-xxl p-4 px-xxl-0">
|
||||
{{- partial "assets/section-title.html" (dict "heading" $args.heading "class" "py-5") -}}
|
||||
|
||||
{{- partial "assets/card-group.html" (dict
|
||||
"page" page
|
||||
"list" $list
|
||||
"class" (printf "border-0 card-icon-primary d-sm-none %s" $args.class)
|
||||
"cols" $args.cols
|
||||
"gutter" "4"
|
||||
"padding" $args.padding
|
||||
"header-style" "none"
|
||||
"footer-style" "none"
|
||||
"icon-rounded" $args.iconRounded
|
||||
"icon-style" "fa-2x"
|
||||
"align" "start"
|
||||
"orientation" ($args.orientation | default "horizontal-sm")
|
||||
"hook" "assets/live-card.html"
|
||||
) -}}
|
||||
|
||||
{{- partial "assets/card-group.html" (dict
|
||||
"page" page
|
||||
"list" $list
|
||||
"class" (printf "border-0 card-icon-primary d-none d-sm-block %s" $args.class)
|
||||
"cols" $args.cols
|
||||
"gutter" "4"
|
||||
"padding" $args.padding
|
||||
"header-style" "none"
|
||||
"footer-style" "none"
|
||||
"icon-rounded" $args.iconRounded
|
||||
"icon-style" "fa-2x"
|
||||
"align" "start"
|
||||
"orientation" ($args.orientation | default "stacked")
|
||||
"hook" "assets/live-card.html"
|
||||
) -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
0
component-library/components/cards/cards.scss
Normal file
0
component-library/components/cards/cards.scss
Normal 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
|
||||
)}}
|
||||
|
@@ -430,6 +430,11 @@ arguments:
|
||||
comment: Path to the download file, relative to the site's static folder.
|
||||
|
||||
# e
|
||||
elements:
|
||||
type: elements
|
||||
optional: false
|
||||
comment: >-
|
||||
Elements to include in the card group. Each element is rendered as a card.
|
||||
external:
|
||||
type: bool
|
||||
optional: true
|
||||
|
@@ -32,6 +32,12 @@ types:
|
||||
items:
|
||||
- title:
|
||||
description:
|
||||
elements:
|
||||
- title:
|
||||
icon:
|
||||
image:
|
||||
mode:
|
||||
content:
|
||||
links:
|
||||
- title:
|
||||
url:
|
||||
|
@@ -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
|
||||
|
40
exampleSite/content/en/blocks/articles.md
Normal file
40
exampleSite/content/en/blocks/articles.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
_schema: default
|
||||
title: Articles
|
||||
description: Use the articles content block to show a group of article cards.
|
||||
icon: fas grip
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The `articles` content block renders a group of article cards.
|
||||
|
||||
<!-- markdownlint-disable MD037 -->
|
||||
{{< example-bookshop lang="bookshop" >}}
|
||||
|
||||
```yml
|
||||
- _bookshop_name: articles
|
||||
heading:
|
||||
title: Blog
|
||||
align: start
|
||||
input:
|
||||
section: blog
|
||||
reverse: false
|
||||
sort: title
|
||||
hide-empty: false
|
||||
header-style: none
|
||||
more:
|
||||
title: More Blogs
|
||||
padding: 0
|
||||
max: 3
|
||||
class: border-0 card-zoom card-body-margin
|
||||
```
|
||||
|
||||
{{< /example-bookshop >}}
|
||||
<!-- markdownlint-enable MD037 -->
|
||||
|
||||
## Arguments
|
||||
|
||||
The content block supports the following arguments:
|
||||
|
||||
{{< args bookshop-articles >}}
|
44
exampleSite/content/en/blocks/cards.md
Normal file
44
exampleSite/content/en/blocks/cards.md
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
_schema: default
|
||||
title: Cards
|
||||
description: Use the cards content block to show a card group of messages.
|
||||
icon: fa address-card
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The `cards` content block renders a group of content cards.
|
||||
|
||||
<!-- markdownlint-disable MD037 -->
|
||||
{{< example-bookshop lang="bookshop" >}}
|
||||
|
||||
```yml
|
||||
- _bookshop_name: cards
|
||||
heading:
|
||||
preheading: Preheading
|
||||
title: Heading
|
||||
content: Cards content. It supports multiple lines.
|
||||
align: start
|
||||
background:
|
||||
color: primary
|
||||
subtle: true
|
||||
orientation: stacked
|
||||
icon-rounded: true
|
||||
class: text-center
|
||||
elements:
|
||||
- title: First Card
|
||||
icon: fas 1
|
||||
- title: Second Card
|
||||
icon: fas 2
|
||||
- title: Third Card
|
||||
icon: fas 3
|
||||
```
|
||||
|
||||
{{< /example-bookshop >}}
|
||||
<!-- markdownlint-enable MD037 -->
|
||||
|
||||
## Arguments
|
||||
|
||||
The content block supports the following arguments:
|
||||
|
||||
{{< args bookshop-cards >}}
|
@@ -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.
|
||||
|
@@ -69,6 +69,7 @@
|
||||
],
|
||||
"classes": [
|
||||
"%!s(<nil>)",
|
||||
"%!s(MISSING)",
|
||||
"about",
|
||||
"accordion",
|
||||
"accordion-body",
|
||||
@@ -99,6 +100,7 @@
|
||||
"bg-body",
|
||||
"bg-body-tertiary",
|
||||
"bg-danger",
|
||||
"bg-info",
|
||||
"bg-opacity-10",
|
||||
"bg-primary",
|
||||
"bg-primary-subtle",
|
||||
@@ -137,6 +139,7 @@
|
||||
"card-container-wrapper",
|
||||
"card-emphasize",
|
||||
"card-icon",
|
||||
"card-icon-primary",
|
||||
"card-icon-secondary",
|
||||
"card-img-bg",
|
||||
"card-img-top",
|
||||
@@ -144,6 +147,7 @@
|
||||
"card-text",
|
||||
"card-title",
|
||||
"card-zoom",
|
||||
"cards",
|
||||
"carousel",
|
||||
"carousel-caption",
|
||||
"carousel-control-next",
|
||||
@@ -224,11 +228,13 @@
|
||||
"fa-3",
|
||||
"fa-4x",
|
||||
"fa-activity",
|
||||
"fa-address-card",
|
||||
"fa-angle-left",
|
||||
"fa-arrow-left",
|
||||
"fa-arrow-right",
|
||||
"fa-bootstrap",
|
||||
"fa-chevron-right",
|
||||
"fa-circle",
|
||||
"fa-circle-check",
|
||||
"fa-circle-play",
|
||||
"fa-circle-question",
|
||||
@@ -242,10 +248,12 @@
|
||||
"fa-fw",
|
||||
"fa-github",
|
||||
"fa-globe",
|
||||
"fa-grip",
|
||||
"fa-h",
|
||||
"fa-heart",
|
||||
"fa-house",
|
||||
"fa-info",
|
||||
"fa-inverse",
|
||||
"fa-link",
|
||||
"fa-linkedin",
|
||||
"fa-magnifying-glass",
|
||||
@@ -256,6 +264,9 @@
|
||||
"fa-share-nodes",
|
||||
"fa-sort",
|
||||
"fa-square-check",
|
||||
"fa-stack",
|
||||
"fa-stack-1x",
|
||||
"fa-stack-2x",
|
||||
"fa-sun",
|
||||
"fa-timeline",
|
||||
"fa-up-right-from-square",
|
||||
@@ -557,8 +568,10 @@
|
||||
"animatie",
|
||||
"animation",
|
||||
"arguments",
|
||||
"background-type",
|
||||
"badge",
|
||||
"barre-de-navigation",
|
||||
"bento-layout",
|
||||
"block-diagram",
|
||||
"blog",
|
||||
"body-docs-collapse-15",
|
||||
@@ -589,9 +602,12 @@
|
||||
"data-tables",
|
||||
"docs",
|
||||
"documentation",
|
||||
"elements-type",
|
||||
"entity-relationship-diagram",
|
||||
"example",
|
||||
"examples",
|
||||
"exemple",
|
||||
"fa-address-card",
|
||||
"fa-face-frown",
|
||||
"fa-square-check",
|
||||
"fab-bootstrap",
|
||||
@@ -602,21 +618,126 @@
|
||||
"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-0207ac25368a51b555ace9fb5d535d51",
|
||||
"faq-0207ac25368a51b555ace9fb5d535d51-heading-faq-0207ac25368a51b555ace9fb5d535d51",
|
||||
"faq-0207ac25368a51b555ace9fb5d535d51-item-0",
|
||||
"faq-0207ac25368a51b555ace9fb5d535d51-item-1",
|
||||
"faq-0207ac25368a51b555ace9fb5d535d51-item-2",
|
||||
"faq-0d9cad3dcfdbf86c0dd499efd640f5fd",
|
||||
"faq-0d9cad3dcfdbf86c0dd499efd640f5fd-heading-faq-0d9cad3dcfdbf86c0dd499efd640f5fd",
|
||||
"faq-0d9cad3dcfdbf86c0dd499efd640f5fd-item-0",
|
||||
"faq-0d9cad3dcfdbf86c0dd499efd640f5fd-item-1",
|
||||
"faq-0d9cad3dcfdbf86c0dd499efd640f5fd-item-2",
|
||||
"faq-1d09cf5c427b65f8401538f5c27cd79a",
|
||||
"faq-1d09cf5c427b65f8401538f5c27cd79a-heading-faq-1d09cf5c427b65f8401538f5c27cd79a",
|
||||
"faq-1d09cf5c427b65f8401538f5c27cd79a-item-0",
|
||||
"faq-1d09cf5c427b65f8401538f5c27cd79a-item-1",
|
||||
"faq-1d09cf5c427b65f8401538f5c27cd79a-item-2",
|
||||
"faq-23d1dc823666431d94080a47fbe2f135",
|
||||
"faq-23d1dc823666431d94080a47fbe2f135-heading-faq-23d1dc823666431d94080a47fbe2f135",
|
||||
"faq-23d1dc823666431d94080a47fbe2f135-item-0",
|
||||
"faq-23d1dc823666431d94080a47fbe2f135-item-1",
|
||||
"faq-23d1dc823666431d94080a47fbe2f135-item-2",
|
||||
"faq-2a2e900fbf55c94afccd3e0096d75d43",
|
||||
"faq-2a2e900fbf55c94afccd3e0096d75d43-heading-faq-2a2e900fbf55c94afccd3e0096d75d43",
|
||||
"faq-2a2e900fbf55c94afccd3e0096d75d43-item-0",
|
||||
"faq-2a2e900fbf55c94afccd3e0096d75d43-item-1",
|
||||
"faq-2a2e900fbf55c94afccd3e0096d75d43-item-2",
|
||||
"faq-385e9a800872a4ef6fc41f292e5ecad0",
|
||||
"faq-385e9a800872a4ef6fc41f292e5ecad0-heading-faq-385e9a800872a4ef6fc41f292e5ecad0",
|
||||
"faq-385e9a800872a4ef6fc41f292e5ecad0-item-0",
|
||||
"faq-385e9a800872a4ef6fc41f292e5ecad0-item-1",
|
||||
"faq-385e9a800872a4ef6fc41f292e5ecad0-item-2",
|
||||
"faq-3ac1e6c7e282c0c3498e241151e870a3",
|
||||
"faq-3ac1e6c7e282c0c3498e241151e870a3-heading-faq-3ac1e6c7e282c0c3498e241151e870a3",
|
||||
"faq-3ac1e6c7e282c0c3498e241151e870a3-item-0",
|
||||
"faq-3ac1e6c7e282c0c3498e241151e870a3-item-1",
|
||||
"faq-3ac1e6c7e282c0c3498e241151e870a3-item-2",
|
||||
"faq-3c82f796666ad7126f45191d8686190a",
|
||||
"faq-3c82f796666ad7126f45191d8686190a-heading-faq-3c82f796666ad7126f45191d8686190a",
|
||||
"faq-3c82f796666ad7126f45191d8686190a-item-0",
|
||||
"faq-3c82f796666ad7126f45191d8686190a-item-1",
|
||||
"faq-3c82f796666ad7126f45191d8686190a-item-2",
|
||||
"faq-42527a8d6149bcb25ba67974f251c9c7",
|
||||
"faq-42527a8d6149bcb25ba67974f251c9c7-heading-faq-42527a8d6149bcb25ba67974f251c9c7",
|
||||
"faq-42527a8d6149bcb25ba67974f251c9c7-item-0",
|
||||
"faq-42527a8d6149bcb25ba67974f251c9c7-item-1",
|
||||
"faq-42527a8d6149bcb25ba67974f251c9c7-item-2",
|
||||
"faq-459acb940e821ec7b38b2425729753a7",
|
||||
"faq-459acb940e821ec7b38b2425729753a7-heading-faq-459acb940e821ec7b38b2425729753a7",
|
||||
"faq-459acb940e821ec7b38b2425729753a7-item-0",
|
||||
"faq-459acb940e821ec7b38b2425729753a7-item-1",
|
||||
"faq-459acb940e821ec7b38b2425729753a7-item-2",
|
||||
"faq-4816264872fdc6847c6a813550673dd0",
|
||||
"faq-4816264872fdc6847c6a813550673dd0-heading-faq-4816264872fdc6847c6a813550673dd0",
|
||||
"faq-4816264872fdc6847c6a813550673dd0-item-0",
|
||||
"faq-4816264872fdc6847c6a813550673dd0-item-1",
|
||||
"faq-4816264872fdc6847c6a813550673dd0-item-2",
|
||||
"faq-501f4a6b834aa1a24043fb5b9f9928c2",
|
||||
"faq-501f4a6b834aa1a24043fb5b9f9928c2-heading-faq-501f4a6b834aa1a24043fb5b9f9928c2",
|
||||
"faq-501f4a6b834aa1a24043fb5b9f9928c2-item-0",
|
||||
"faq-501f4a6b834aa1a24043fb5b9f9928c2-item-1",
|
||||
"faq-501f4a6b834aa1a24043fb5b9f9928c2-item-2",
|
||||
"faq-524a2784206986528a599f1fad6821f4",
|
||||
"faq-524a2784206986528a599f1fad6821f4-heading-faq-524a2784206986528a599f1fad6821f4",
|
||||
"faq-524a2784206986528a599f1fad6821f4-item-0",
|
||||
"faq-524a2784206986528a599f1fad6821f4-item-1",
|
||||
"faq-524a2784206986528a599f1fad6821f4-item-2",
|
||||
"faq-53c9868792ab3037787bf28bb9675fa4",
|
||||
"faq-53c9868792ab3037787bf28bb9675fa4-heading-faq-53c9868792ab3037787bf28bb9675fa4",
|
||||
"faq-53c9868792ab3037787bf28bb9675fa4-item-0",
|
||||
"faq-53c9868792ab3037787bf28bb9675fa4-item-1",
|
||||
"faq-53c9868792ab3037787bf28bb9675fa4-item-2",
|
||||
"faq-74cbe70765110cf6e9067513ca5741c2",
|
||||
"faq-74cbe70765110cf6e9067513ca5741c2-heading-faq-74cbe70765110cf6e9067513ca5741c2",
|
||||
"faq-74cbe70765110cf6e9067513ca5741c2-item-0",
|
||||
"faq-74cbe70765110cf6e9067513ca5741c2-item-1",
|
||||
"faq-74cbe70765110cf6e9067513ca5741c2-item-2",
|
||||
"faq-90908ae510b7d45ff54c4b6c9c8ca008",
|
||||
"faq-90908ae510b7d45ff54c4b6c9c8ca008-heading-faq-90908ae510b7d45ff54c4b6c9c8ca008",
|
||||
"faq-90908ae510b7d45ff54c4b6c9c8ca008-item-0",
|
||||
"faq-90908ae510b7d45ff54c4b6c9c8ca008-item-1",
|
||||
"faq-90908ae510b7d45ff54c4b6c9c8ca008-item-2",
|
||||
"faq-9801f2465268421d28e3a2e740e301ba",
|
||||
"faq-9801f2465268421d28e3a2e740e301ba-heading-faq-9801f2465268421d28e3a2e740e301ba",
|
||||
"faq-9801f2465268421d28e3a2e740e301ba-item-0",
|
||||
"faq-9801f2465268421d28e3a2e740e301ba-item-1",
|
||||
"faq-9801f2465268421d28e3a2e740e301ba-item-2",
|
||||
"faq-c4ef1fd75a3eb53e09b547b23bc8dc7d",
|
||||
"faq-c4ef1fd75a3eb53e09b547b23bc8dc7d-heading-faq-c4ef1fd75a3eb53e09b547b23bc8dc7d",
|
||||
"faq-c4ef1fd75a3eb53e09b547b23bc8dc7d-item-0",
|
||||
"faq-c4ef1fd75a3eb53e09b547b23bc8dc7d-item-1",
|
||||
"faq-c4ef1fd75a3eb53e09b547b23bc8dc7d-item-2",
|
||||
"faq-d47a09f567ff25b85143b638bc68d60f",
|
||||
"faq-d47a09f567ff25b85143b638bc68d60f-heading-faq-d47a09f567ff25b85143b638bc68d60f",
|
||||
"faq-d47a09f567ff25b85143b638bc68d60f-item-0",
|
||||
"faq-d47a09f567ff25b85143b638bc68d60f-item-1",
|
||||
"faq-d47a09f567ff25b85143b638bc68d60f-item-2",
|
||||
"faq-dc8be8c7cb908eadcc4f0cb98b4709fb",
|
||||
"faq-dc8be8c7cb908eadcc4f0cb98b4709fb-heading-faq-dc8be8c7cb908eadcc4f0cb98b4709fb",
|
||||
"faq-dc8be8c7cb908eadcc4f0cb98b4709fb-item-0",
|
||||
"faq-dc8be8c7cb908eadcc4f0cb98b4709fb-item-1",
|
||||
"faq-dc8be8c7cb908eadcc4f0cb98b4709fb-item-2",
|
||||
"faq-df9f1eb3ec26e3252a2d045e833601d9",
|
||||
"faq-df9f1eb3ec26e3252a2d045e833601d9-heading-faq-df9f1eb3ec26e3252a2d045e833601d9",
|
||||
"faq-df9f1eb3ec26e3252a2d045e833601d9-item-0",
|
||||
"faq-df9f1eb3ec26e3252a2d045e833601d9-item-1",
|
||||
"faq-df9f1eb3ec26e3252a2d045e833601d9-item-2",
|
||||
"faq-eafa3d5085c4f74847a727982753379e",
|
||||
"faq-eafa3d5085c4f74847a727982753379e-heading-faq-eafa3d5085c4f74847a727982753379e",
|
||||
"faq-eafa3d5085c4f74847a727982753379e-item-0",
|
||||
"faq-eafa3d5085c4f74847a727982753379e-item-1",
|
||||
"faq-eafa3d5085c4f74847a727982753379e-item-2",
|
||||
"faq-eb4b749d4172f3bcae459d57f9d4cfb5",
|
||||
"faq-eb4b749d4172f3bcae459d57f9d4cfb5-heading-faq-eb4b749d4172f3bcae459d57f9d4cfb5",
|
||||
"faq-eb4b749d4172f3bcae459d57f9d4cfb5-item-0",
|
||||
"faq-eb4b749d4172f3bcae459d57f9d4cfb5-item-1",
|
||||
"faq-eb4b749d4172f3bcae459d57f9d4cfb5-item-2",
|
||||
"faq-ff66f007edb5cdfca29cb7a3e0b4795c",
|
||||
"faq-ff66f007edb5cdfca29cb7a3e0b4795c-heading-faq-ff66f007edb5cdfca29cb7a3e0b4795c",
|
||||
"faq-ff66f007edb5cdfca29cb7a3e0b4795c-item-0",
|
||||
"faq-ff66f007edb5cdfca29cb7a3e0b4795c-item-1",
|
||||
"faq-ff66f007edb5cdfca29cb7a3e0b4795c-item-2",
|
||||
"fas-1",
|
||||
"fas-2",
|
||||
"fas-3",
|
||||
@@ -624,6 +745,7 @@
|
||||
"fas-arrow-left",
|
||||
"fas-arrow-right",
|
||||
"fas-chevron-right",
|
||||
"fas-circle",
|
||||
"fas-circle-check",
|
||||
"fas-circle-play",
|
||||
"fas-circle-question",
|
||||
@@ -631,6 +753,7 @@
|
||||
"fas-divide",
|
||||
"fas-ellipsis",
|
||||
"fas-globe",
|
||||
"fas-grip",
|
||||
"fas-h",
|
||||
"fas-heart",
|
||||
"fas-house",
|
||||
@@ -657,6 +780,7 @@
|
||||
"git-graph",
|
||||
"groupe-de-boutons",
|
||||
"groupe-de-cartes",
|
||||
"guides",
|
||||
"gérer-les-préférences-des-cookies",
|
||||
"heading",
|
||||
"heading-type",
|
||||
@@ -669,6 +793,7 @@
|
||||
"imgix",
|
||||
"indicateur-de-chargement",
|
||||
"infobulle",
|
||||
"input-type",
|
||||
"ins",
|
||||
"invite-de-commandes",
|
||||
"items-type",
|
||||
@@ -687,6 +812,7 @@
|
||||
"mermaid-diagrams",
|
||||
"messages-type",
|
||||
"mindmap",
|
||||
"more-type",
|
||||
"nav",
|
||||
"nav-0-0",
|
||||
"nav-0-1",
|
||||
|
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,10 @@
|
||||
|
||||
{{- 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
|
||||
"class" (printf "%s d-none-%s" $args.class (cond (eq $suffix "dark") "light" "dark"))
|
||||
) -}}
|
||||
{{- 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
|
||||
|
@@ -27,7 +27,12 @@
|
||||
{{- $page := $args.page -}}
|
||||
{{- $data := partial "utilities/GetI18nData.html" (dict "page" $page "data" $args.data) }}
|
||||
{{ if not $data -}}
|
||||
{{ errorf "Invalid timeline data '%s': %s" $page.File -}}
|
||||
{{ partial "utilities/LogErr.html" (dict
|
||||
"partial" "assets/timeline.html"
|
||||
"msg" "Invalid arguments"
|
||||
"details" (slice (printf "Invalid timeline data '%s'" $args.data))
|
||||
"file" page.File
|
||||
)}}
|
||||
{{ $error = true }}
|
||||
{{ end -}}
|
||||
{{ $background := partial "utilities/GetBackgroundStyle.html" (dict "background" $args.background) }}
|
||||
@@ -79,7 +84,10 @@
|
||||
{{ $datestr := (partial "utilities/date.html" (dict "date" $date "format" "long")) -}}
|
||||
<p class="mb-0"><small class="text-body-secondary text-uppercase">{{ $datestr -}}</small></p>
|
||||
{{ end }}
|
||||
<p class="mt-3 mb-0">{{ $content | $page.RenderString }}</p>
|
||||
<p class="mt-3 mb-0">
|
||||
<!-- TODO: $page.RenderString causes an out of bounds error -->
|
||||
{{ $content | markdownify }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user