Compare commits

..

47 Commits

Author SHA1 Message Date
Mark Dumay
d27c04dc64 Merge pull request #688 from gethinode/validation
Refine args handling
2023-12-30 06:36:59 +01:00
Mark Dumay
b0c8326255 Merge branch 'main' into validation 2023-12-30 06:26:40 +01:00
mark
99a35a3ffd Bump package release 2023-12-30 06:26:07 +01:00
mark
c5673efea2 Refine sub and sup args 2023-12-30 06:14:07 +01:00
mark
c3b48e0033 Refine spinner args 2023-12-30 06:09:09 +01:00
mark
5aa57dd402 Refine release args 2023-12-30 06:04:42 +01:00
mark
d919d3f068 Refina nav-item args 2023-12-30 05:59:41 +01:00
mark
38ad418005 Support individual fade arg 2023-12-30 05:59:30 +01:00
mark
ba50786118 Refine nav-item comments 2023-12-29 19:14:04 +01:00
mark
aee3cb3e03 Refine nav args 2023-12-29 19:12:05 +01:00
mark
61430b07e2 Refine navbar args 2023-12-29 18:01:36 +01:00
mark
5d393598c5 Refine the mark args 2023-12-29 15:10:16 +01:00
mark
4b0c075b53 Refine the link args 2023-12-29 15:06:13 +01:00
github-actions[bot]
2b5b6434da Merge pull request #687 from gethinode/dependabot/npm_and_yarn/eslint-plugin-n-16.6.0
Bump eslint-plugin-n from 16.5.0 to 16.6.0
2023-12-29 14:01:36 +00:00
mark
ae0877037a Refine the image args 2023-12-29 14:59:08 +01:00
dependabot[bot]
64a12da2e6 Bump eslint-plugin-n from 16.5.0 to 16.6.0
Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 16.5.0 to 16.6.0.
- [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases)
- [Commits](https://github.com/eslint-community/eslint-plugin-n/compare/16.5.0...16.6.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-n
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-29 13:56:13 +00:00
mark
6865fa40f7 Refine the file args 2023-12-29 14:51:00 +01:00
mark
79632aeed0 Use long form for ID 2023-12-29 14:46:27 +01:00
mark
6f03f3e5fd Refine the example args 2023-12-29 14:46:05 +01:00
mark
df53150972 Refine the docs args 2023-12-29 14:38:29 +01:00
mark
9282cd630d Add missing punctuation 2023-12-29 11:04:12 +01:00
mark
a3eb2fc7cc Refine carousel-item definition 2023-12-29 10:58:05 +01:00
mark
4e39d03240 Refine carousel definition 2023-12-29 10:53:45 +01:00
mark
8cadb30179 Refine button definition 2023-12-29 10:46:45 +01:00
mark
d2c02ca016 Add label alias 2023-12-29 10:46:30 +01:00
mark
1bbfba32a5 Support label alias 2023-12-29 10:45:46 +01:00
mark
cf59cc3a49 Make badge title required 2023-12-29 08:07:06 +01:00
mark
897db61ee2 Fix color of info alert 2023-12-29 08:01:58 +01:00
mark
ac14ac23fb Improve styling of elements 2023-12-29 08:01:43 +01:00
mark
0f1bc34d37 Improve card and card-group arg handling 2023-12-29 07:40:32 +01:00
mark
26d318356f Fix int range init 2023-12-29 06:35:24 +01:00
mark
9f4a0d35b6 Fix inline arg init 2023-12-29 06:17:01 +01:00
mark
a201be6487 Remove debug statement 2023-12-28 17:36:27 +01:00
Mark Dumay
380ebcd1d8 Merge pull request #686 from gethinode/validation
Fix purge settings and arg init
2023-12-28 17:34:07 +01:00
Mark Dumay
c06499033d Merge branch 'main' into validation 2023-12-28 17:17:49 +01:00
mark
0874957993 Bump package release 2023-12-28 17:16:56 +01:00
mark
6019c7412f Update build stats 2023-12-28 17:16:24 +01:00
mark
30c300cabf Fix bool args init 2023-12-28 17:16:16 +01:00
mark
46f11f02ab Fix default color 2023-12-28 17:03:21 +01:00
mark
71e6029117 Exclude embedded video styles from purging 2023-12-28 15:45:49 +01:00
Mark Dumay
5c67da7882 Merge pull request #685 from gethinode/validation
Fix args validation
2023-12-28 15:16:26 +01:00
Mark Dumay
af4f6de4b9 Merge branch 'main' into validation 2023-12-28 15:05:45 +01:00
mark
9b173d6c68 Bump package version 2023-12-28 15:04:59 +01:00
mark
2f4fb5230d Fix type conversion 2023-12-28 15:04:10 +01:00
mark
9144a1fec3 Fix args 2023-12-28 15:03:48 +01:00
mark
4192af1d46 Fix width arg 2023-12-28 15:02:44 +01:00
mark
0e72124cdc Fix cols arg 2023-12-28 15:02:25 +01:00
39 changed files with 176 additions and 116 deletions

View File

@@ -21,6 +21,7 @@ const purgecss = require('@fullhuman/postcss-purgecss')({
'./assets/scss/components/_syntax-dark.scss',
'./assets/scss/components/_syntax-light.scss',
'./assets/scss/components/_table.scss',
'./assets/scss/components/_video.scss',
'./assets/scss/theme/fonts.scss',
'./assets/scss/theme/theme.scss',
'./_vendor/github.com/gethinode/mod-flexsearch/assets/scss/modules/flexsearch/flexsearch.scss',

View File

@@ -6,7 +6,7 @@ arguments:
type: string
optional: true
comment: >-
ID of the accordion, defaults to accordion-n with a sequential number n.
ID of the accordion, defaults to `accordion-n` with a sequential number n.
always-open:
type: bool
optional: true
@@ -15,4 +15,4 @@ arguments:
class:
type: string
optional: true
comment: Class attribute of the accordion, e.g. w-50.
comment: Class attribute of the accordion, e.g. `w-50`.

View File

@@ -3,7 +3,7 @@ comment: >-
arguments:
title:
type: string
optional: true
optional: false
comment: >-
Title of the badge.
class:

View File

@@ -12,7 +12,7 @@ arguments:
type: string
optional: true
comment: >-
Class attribute of the button element, e.g. p-5.
Class attribute of the button element, e.g. `p-5`.
color:
type: select
optional: true
@@ -48,7 +48,7 @@ arguments:
id:
type: string
optional: true
comment: ID of the button, to be used in the DOM.
comment: Identifier of the button, to be used in the DOM.
state:
type: select
optional: true
@@ -61,7 +61,7 @@ arguments:
- active
- inactive
size:
type: string
type: select
optional: true
default: md
comment: Size of the button.
@@ -85,7 +85,12 @@ arguments:
comment: >-
Assistive label for the button or badge. The label is applied
to the badge instead of the button when a badge has been defined.
The default value of the button aria-label is its title.
The default value of the button's assistive label is its title.
aria-label:
type: string
optional: true
comment: Alias for label.
group: shortcode
tooltip:
type: string
optional: true
@@ -108,7 +113,7 @@ arguments:
- link
- button
placement:
type: string
type: select
optional: true
default: top
comment: Position of the tooltip.
@@ -134,7 +139,7 @@ arguments:
- first
- last
justify:
type: string
type: select
optional: true
default: center
comment: Justification of the button title and icon.
@@ -149,7 +154,7 @@ arguments:
toast:
type: string
optional: true
comment: ID of the toast to display when the button is clicked.
comment: Identifier (ID) of the toast to display when the button is clicked.
clipboard:
type:
- string
@@ -174,6 +179,7 @@ arguments:
comment: >-
Dictionary of key-value pairs added as custom attributes to the button
element ('<a>').
group: partial
spacing:
type: bool
optional: true

View File

@@ -11,11 +11,11 @@ arguments:
- '*hugolib.pageForShortcode'
optional: true
comment: Context of the current page.
group: partial
title:
type: string
optional: true
comment: >-
Title of the card, replaces the title of the referenced page (if any).
comment: Title of the card group.
gutter:
type: int
optional: true
@@ -24,45 +24,58 @@ arguments:
options:
min: 0
max: 5
release: v0.19.0
list:
type:
- page.Pages
- resource.Resources
optional: true
comment: Array of pages to be rendered as cards.
group: partial
cards:
type: string
optional: true
comment: String of rendered cards.
group: partial
max:
type: int
optional: true
comment: Maximum number of cards to display.
group: partial
cols:
type: int
type: select
optional: true
default: 3
default: "3"
comment: Number of grid columns.
options:
min: 1
max: 5
values:
- "1"
- "2"
- "3"
- "4"
- "5"
- "auto"
release: v0.19.0
paginate:
type: bool
optional: true
comment: >-
Flag indicating if pagination should be added to the card group, if the
list exceeds the maximum number of cards to display.
group: partial
href:
type: string
optional: true
comment: >-
address for the button or hyperlink. If set, a button is added if the
Address for the button or hyperlink. If set, a button is added if the
list exceeds the maximum number of cards to display.
group: partial
hrefTitle:
type: string
optional: true
comment: >-
Title of the button or hyperlink as companion to href.
group: partial
separator:
type: bool
optional: true

View File

@@ -108,15 +108,14 @@ arguments:
- string
- template.HTML
optional: true
parent: cascade
comment: >-
Description of the card.
group: partial
loading:
type: select
optional: true
default: eager
parent: cascade
default: eager
comment: >-
Loading behavior of the image. The loading of lazily loaded images is
deferred until the image is within scrolling range of the viewport. This
@@ -130,7 +129,6 @@ arguments:
thumbnail:
type: path
optional: true
parent: cascade
comment: >-
Thumbnail image url, displayed on top or the left of the card.
ratio:
@@ -157,7 +155,6 @@ arguments:
icon:
type: string
optional: true
parent: cascade
comment: >-
Font Awesome icon, displayed on top or the left of the card.
orientation:

View File

@@ -24,6 +24,7 @@ arguments:
- 4x3
- 16x9
- 21x9
group: partial
portrait:
type: bool
optional: true
@@ -32,6 +33,7 @@ arguments:
Flag to adjust the ratio from landscape to portrait. The image itself
is not rotated, only the crop area is adjusted. Not applicable to vector
graphics.
group: partial
loading:
type: select
default: eager

View File

@@ -1,14 +1,14 @@
comment: >-
Displays a carousel of several responsive images (see the image shortcode for
more details). Add inner <img> elements to define individual image slides.
more details). Add inner `img` elements to define individual image slides.
arguments:
id:
type: string
optional: true
comment: >-
ID of the carousel, defaults to `carousel-` with a sequential number.
ID of the carousel, defaults to `carousel-n` with a sequential number `n`.
ratio:
type: string
type: select
optional: true
comment: >-
Ratio of the images. If set, the images are resized and cropped to match the
@@ -28,11 +28,12 @@ arguments:
Flag to adjust the ratio from landscape to portrait. The images themselves
are not rotated, only the crop area is adjusted. Not applicable to vector
graphics.
release: v0.18.3
class:
type: string
optional: true
comment: Class attribute of the carousel element, e.g. w-75.
comment: Class attribute of the carousel element, e.g. `w-75`.
body:
type: string
optional: false
comment: Inner <img> elements that define the individual image slides.
comment: Inner `img` elements that define the individual image slides.

View File

@@ -18,7 +18,7 @@ arguments:
type: select
optional: true
default: bash
comment: Type of shell
comment: Type of shell.
options:
values:
- bash

View File

@@ -30,11 +30,15 @@ arguments:
optional: true
default: true
comment: >-
If unset, shows the filename only. By default, the full relative path is
shown.
If unset, shows the filename only. By default, the entire path (relative
to the base path) is shown.
id:
type: string
optional: true
comment: >-
ID of the collapse panel holding the code snippet, defaults to
`docs-collapse-n` with a sequential number `n` starting at `1`.
class:
type: string
optional: true
comment: Class attribute of the tab control that wraps the docs element.

View File

@@ -2,11 +2,17 @@ comment: >-
Display a code example and render a preview of the same input. The shortcode
accepts the languages supported by Hugo's highlight function.
arguments:
id:
type: string
optional: true
comment: Identifier of the elements container.
lang:
type: string
optional: true
default: markdown
comment: Language used to display the code.
comment: >-
Language used to display the code. Use `hugo` to process Hugo (escaped)
shortcodes.
show_markup:
type: bool
optional: true

View File

@@ -21,19 +21,20 @@ arguments:
comment: >-
If unset, shows the panel with the code in collapsed state. By default,
the panel is expanded.
full:
type: string
full:
type: bool
optional: true
default: true
comment: >-
If unset, shows the filename only. By default, the full relative path is
shown.
If unset, shows the filename only. By default, the entire path (relative
to the base path) is shown.
id:
type: string
optional: true
comment: >-
ID of the collapse panel, defaults to `file-collapse-n` with a sequential
number `n` starting at 1.
Identifier of the collapse panel, defaults to `file-collapse-n` with a
sequential number `n` starting at 1.
class:
type: string
optional: true
comment: Class argument of the tab control.
comment: Class attribute of the tab control that wraps the file element.

View File

@@ -21,7 +21,10 @@ arguments:
url:
type: string
optional: true
comment: Path or url of the image, e.g. `img/example.jpg`.
comment: >-
Path or url of the image, e.g. `img/example.jpg`. Images with multiple
color modes are expected to have a basename that ends with either `-dark`
or `-light`.
src:
type: string
optional: true
@@ -39,9 +42,12 @@ arguments:
type: bool
default: false
optional: true
comment: Flag indicating if the image should support color modes.
comment: >-
Flag indicating if the image should support color modes. If set, the
shortcode searches for images that having a matching color-mode suffix
such as `-light` or `-dark`.
ratio:
type: string
type: select
optional: true
comment: >-
Ratio of the image. If set, the image is resized and cropped to match the
@@ -62,6 +68,7 @@ arguments:
Flag to adjust the ratio from landscape to portrait. The image itself is
not rotated, only the crop area is adjusted. Not applicable to vector
graphics.
release: v0.18.3
loading:
type: select
default: eager
@@ -75,6 +82,7 @@ arguments:
values:
- eager
- lazy
release: v0.21.0
priority:
type: select
default: auto
@@ -102,6 +110,7 @@ arguments:
type: string
optional: true
comment: Class attributes of the wrapper element, e.g. `mx-auto`.
release: v0.18.3
class:
type: string
optional: true

View File

@@ -25,8 +25,8 @@ arguments:
position: 0
optional: true
comment: >-
Reference to either an external link (if it starts with http), a named
link (if it can be found in params.links), or internal reference.
Reference to either an external link (if it starts with `http`), a named
link (if it can be found in `params.links`), or internal reference.
Both external and internal references may include an anchor `#`.
name:
type: string

View File

@@ -9,7 +9,7 @@ arguments:
optional: true
comment: >-
Theme color of the highlight. By default, the highlight uses the color of
the HTML mark function.
the HTML mark function (usually yellow).
options:
values:
- primary

View File

@@ -1,25 +1,25 @@
comment: >-
Defines an individual nav item.
Defines an individual item.
arguments:
id:
type: string
optional: true
comment: ID of the nav-item.
parent: cascade
comment: Identification of the item.
group: partial
parentID:
type: string
optional: false
comment: ID of the parent (e.g. nav control).
comment: Identification of the parent (e.g. nav control).
group: partial
header:
type: string
optional: false
comment: Header of the nav item.
comment: Header of the item.
show:
type: bool
optional: true
comment: >-
Flag to indicate the nav item should be shown. Only one can be shown at a
Flag to indicate if the item should be shown. Only one can be shown at a
time.
disabled:
type: bool
@@ -33,13 +33,13 @@ arguments:
class:
type: string
optional: true
comment: Class attribute of the nav item.
comment: Class attribute of the item.
body:
type:
- string
- template.HTML
optional: true
comment: The body content of the nav-item, supports Markdown and HTML (if enabled).
comment: The body content of the item, supports Markdown and HTML (if enabled).
group: partial
item_type:
type: select
@@ -52,5 +52,5 @@ arguments:
group: partial
body:
optional: false
comment: Content of the nav item.
comment: Content of the item.
group: shortcode

View File

@@ -44,7 +44,7 @@ arguments:
class:
type: string
optional: true
comment: Class attribute of the tab group, e.g. nav-fill.
comment: Class attribute of the tab group, e.g. `nav-fill`.
pane:
type: select
optional: true
@@ -58,12 +58,12 @@ arguments:
width:
type: select
optional: true
default: 100
default: "100"
comment: Responsive width of the tab group.
options:
values:
- 50
- 100
- "50"
- "100"
group: partial
loading:
type: select

View File

@@ -28,7 +28,12 @@ arguments:
color:
type: select
optional: true
comment: Background theme color of the navbar.
comment: >-
Background theme color of the navbar. Set the color to `body` or
`body-tertiary` for the navbar to respond to color mode changes (e.g.
switching between dark and light). The navigation bar is transparent when
no color is set, but is set to the body color when scrolling to enhance
the contrast.
options:
values:
- primary
@@ -47,9 +52,9 @@ arguments:
type: string
optional: true
comment: >-
ID of the navbar, defaults to `navbar-0`. The id is used by several child
elements, including a color mode switcher, version switcher, and collapse
panel.
Identification of the navbar, defaults to `navbar-0`. The id is used by
several child elements, including a color mode switcher, version switcher,
and collapse panel.
menus:
type: string
optional: true
@@ -76,6 +81,7 @@ arguments:
values:
- light
- dark
group: partial
mode:
type: bool
optional: true

View File

@@ -23,7 +23,7 @@ arguments:
type: select
optional: true
default: md
comment: Size of the button
comment: Size of the button.
options:
values:
- sm
@@ -36,4 +36,5 @@ arguments:
inline:
type: bool
optional: true
comment: Flag to render the release button inline (defaults to false).
default: false
comment: Flag to render the release button inline.

View File

@@ -6,7 +6,7 @@ arguments:
type: string
optional: true
comment: >-
Class attribute of the wrapping element, e.g. text-center.
Class attribute of the wrapping element, e.g. `text-center`.
color:
type: select
optional: true

View File

@@ -5,4 +5,4 @@ arguments:
type: string
optional: false
position: 0
comment: Text to display in subscript.
comment: Text to display in subscript. You can omit the argument name.

View File

@@ -5,4 +5,4 @@ arguments:
type: string
optional: false
position: 0
comment: Text to display in superscript.
comment: Text to display in superscript. You can omit the argument name.

View File

@@ -18,7 +18,7 @@ arguments:
type: string
optional: false
position: 0
comment: ID of the video to be embedded.
comment: Identifier of the video to be embedded.
autoplay:
type: bool
optional: true

View File

@@ -21,6 +21,7 @@ const purgecss = require('@fullhuman/postcss-purgecss')({
'./assets/scss/components/_syntax-dark.scss',
'./assets/scss/components/_syntax-light.scss',
'./assets/scss/components/_table.scss',
'./assets/scss/components/_video.scss',
'./assets/scss/theme/fonts.scss',
'./assets/scss/theme/theme.scss',
'./_vendor/github.com/gethinode/mod-flexsearch/assets/scss/modules/flexsearch/flexsearch.scss',

View File

@@ -39,14 +39,8 @@
"sub",
"sup",
"svg",
"table",
"tbody",
"td",
"th",
"thead",
"time",
"title",
"tr",
"ul",
"use"
],
@@ -379,8 +373,6 @@
"syntax-highlight",
"tab-content",
"tab-pane",
"table",
"table-responsive",
"tag-link",
"text-bg-body",
"text-bg-body-tertiary",

View File

@@ -84,12 +84,13 @@
{{- $params := (dict
"class" (printf "h-100 %s" $class)
"color" $color
"padding" $padding
"header" $header
"footer" $footer
"orientation" $orientation
"ratio" $ratio
"gutter" $gutter
"header" $header
"loading" $loading
"orientation" $orientation
"padding" $padding
"ratio" $ratio
) -}}
{{- $params = merge $params $element }}

View File

@@ -4,6 +4,8 @@
Visit gethinode.com/license for more details.
-->
<!-- TODO: consider to drop style arg -->
{{ $error := false }}
<!-- Validate arguments -->

View File

@@ -26,7 +26,7 @@
{{- $content := .content -}}
{{- $thumbnail := .thumbnail -}}
{{- $color := .color -}}
{{- $color := .color | default "primary" -}}
{{- with $page -}}
{{- if not $title }}{{ $title = .Title }}{{ end -}}

View File

@@ -32,7 +32,7 @@
{{- $layout := "card" -}}
{{- $pane := "none" -}}
{{- $type := "pills" -}}
{{- $vertical := "false" -}}
{{- $vertical := false -}}
{{- $width := 100 -}}
{{- $ratio := "" -}}
{{- $wrap := false -}}
@@ -58,11 +58,11 @@
{{- with index . "layout" }}{{ $layout = . }}{{ end -}}
{{- with index . "pane" }}{{ $pane = . }}{{ end -}}
{{- with index . "type" }}{{ $type = . }}{{ end -}}
{{- with index . "vertical" }}{{ $vertical = . }}{{ end -}}
{{- with index . "vertical" }}{{ $vertical = partial "utilities/CastBool.html" . }}{{ end -}}
{{- with index . "width" }}{{ $width = . }}{{ end -}}
{{- with index . "kind" }}{{ $kind = . }}{{ end -}}
{{- with index . "ratio" }}{{ $ratio = . }}{{ end -}}
{{- with index . "wrap" }}{{ $wrap = . }}{{ end -}}
{{- with index . "wrap" }}{{ $wrap = partial "utilities/CastBool.html" . }}{{ end -}}
{{- end -}}
{{ if isset $page.Params "nested" }}
@@ -151,20 +151,17 @@
{{- $params := (dict
"page" $page
"list" $list
"title" $title
"icon" $icon
"thumbnail" $thumbnail
"ratio" $ratio
"description" $description
"class" $style
"color" $color
"loading" $loading
)
-}}
{{ if eq $layout "card" }}
{{- $partial = "assets/card-group.html" -}}
{{- $params = merge $params (dict
"title" $title
"ratio" $ratio
"color" $color
"loading" $loading
"max" $max
"cols" $cols
"href" $sectionURL
@@ -180,7 +177,6 @@
{{ else if eq $layout "nav" }}
{{- $partial = "assets/nav.html" -}}
{{- $params = merge $params (dict
"layout" $layout
"id" $section
"pane" $pane
"type" $type
@@ -192,6 +188,13 @@
{{- else -}}
{{- $partial = "assets/list.html" -}}
{{- $params = merge $params (dict
"title" $title
"icon" $icon
"thumbnail" $thumbnail
"ratio" $ratio
"description" $description
"color" $color
"loading" $loading
"layout" $layout
)
-}}

View File

@@ -86,8 +86,9 @@
{{ $actual = "int" }}
{{ else if and (in $expected "float") (findRE `^(?:[1-9]\d*|0)?(?:\.\d+)?$` $val) }}
{{ $actual = "float" }}
{{ else if and (in $expected "string") (in (slice "bool" "int" "float" "float64") $actual) }}
{{ else if and (in $expected "string") (in (slice "bool" "int" "int64" "float" "float64") $actual) }}
{{ $actual = "string" }}
{{ $val = string $val }}
{{ end }}
{{ if and $val (not (in $expected $actual)) }}

View File

@@ -16,7 +16,13 @@
{{ $color := .Get "color" | default "danger" -}}
{{ $icon := .Get "icon" | default "" }}
{{ $type := .Get "type" | default "" -}}
{{ if eq $type "danger" }}{{ $icon = "fas triangle-exclamation" }}{{ else if eq $type "info" }}{{ $icon = "fa lightbulb" }}{{ end }}
{{ if eq $type "danger" }}
{{ $icon = "fas triangle-exclamation" }}
{{ $color = "danger" }}
{{ else if eq $type "info" }}
{{ $icon = "fa lightbulb" }}
{{ $color = "info" }}
{{ end }}
{{ with $icon }}
{{ $icon = partial "assets/icon.html" (dict "icon" (printf "%s fa-2x fa-fw" .)) }}
{{ end }}

View File

@@ -63,16 +63,15 @@
{{ $max := "" }}
{{ if and $val.options.values (eq $type "select") }}
{{ $comment = printf "%s %s: [%s]." $comment (T "supportedValues") (delimit $val.options.values ", ") }}
{{ else if and $val.options.min (in (slice "int" "float" "float64") $type) }}
{{ $min = $val.options.min }}
{{ else if and $val.options.max (in (slice "int" "float" "float64") $type) }}
{{ $max = $val.options.max }}
{{ 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 $min $max }}
{{ 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 $min }}
{{ else if (eq (printf "%T" $min) "int") }}
{{ $comment = printf "%s %s: >=%d." $comment (T "supportedValues") $min }}
{{ else if $max }}
{{ else if (eq (printf "%T" $max) "int") }}
{{ $comment = printf "%s %s: <=%d." $comment (T "supportedValues") $max }}
{{ end }}

View File

@@ -28,7 +28,7 @@
{{ $outline := false -}}
{{ with .Get "outline" }}{{ $outline = partial "utilities/CastBool.html" . }}{{ end -}}
{{ $badge := .Get "badge" | default "" -}}
{{ $label := .Get "label" | default "" -}}
{{ $label := or (.Get "label") (.Get "aria-label") | default "" -}}
{{ $tooltip := .Get "tooltip" | default "" -}}
{{ $collapse := .Get "collapse" | default "" -}}
{{ $href := .Get "href" | default "" -}}

View File

@@ -14,9 +14,11 @@
{{- $gutter := .Get "gutter" | default "4" -}}
{{- $title := .Get "title" | default "" -}}
{{- $separator := .Get "separator" | default "" -}}
{{- $class := .Get "class" | default "" -}}
{{- $wrapper := .Get "wrapper" | default "" -}}
{{- $responsive := .Get "responsive" | default true -}}
<!-- Initialize arguments passed to individual cards -->
{{- $class := .Get "class" | default "" -}}
{{- $color := .Get "color" | default "" -}}
{{- $padding := .Get "padding" | default "auto" -}}
{{- $header := .Get "header" | default "" -}}

View File

@@ -21,8 +21,10 @@
{{- $gutter := partial "utilities/GetArgParent" (dict "page" . "arg" "gutter") | default "0" -}}
{{- $header := partial "utilities/GetArgParent" (dict "page" . "arg" "header") | default "full" -}}
{{- $icon := .Get "icon" -}}
{{- $loading := .Get "loading" -}}
{{- $orientation := partial "utilities/GetArgParent" (dict "page" . "arg" "orientation") | default "stacked" -}}
{{- $padding := partial "utilities/GetArgParent" (dict "page" . "arg" "padding") | default "auto" -}}
{{- $ratio := partial "utilities/GetArgParent" (dict "page" . "arg" "ratio") | default "" -}}
{{- $page := .Page -}}
{{- $path := .Get "path" -}}
{{- $thumbnail := .Get "thumbnail" -}}
@@ -55,8 +57,10 @@
"footer" $footer
"orientation" $orientation
"description" $description
"ratio" $ratio
"icon" $icon
"thumbnail" $thumbnail
"loading" $loading
"alt" $alt
) -}}

View File

@@ -24,9 +24,10 @@
{{- end -}}
{{- $fade := false -}}
{{- if eq (.Parent.Get "fade") "true" -}}
{{- $fade = true -}}
{{- end -}}
{{ with .Get "fade" }}{{ $fade = partial "utilities/CastBool.html" . }}{{ end -}}
{{- $parentFade := false }}
{{ with .Parent.Get "fade" }}{{ $parentFade = partial "utilities/CastBool.html" . }}{{ end -}}
{{ $fade = or $fade $parentFade }}
{{- $header := .Get "header" | default "" -}}
{{- $class := .Get "class" | default "" -}}
{{- $body := trim .Inner " \r\n" | .Page.RenderString -}}

View File

@@ -18,7 +18,7 @@
{{- $short := false -}}
{{ with .Get "short" }}{{ $short = partial "utilities/CastBool.html" . }}{{ end -}}
{{- $inline := false -}}
{{ with .Get "inline" }}{{ $short = partial "utilities/CastBool.html" . }}{{ end -}}
{{ with .Get "inline" }}{{ $inline = partial "utilities/CastBool.html" . }}{{ end -}}
{{- $title := $version -}}
{{- $color := "primary" -}}
{{- if eq $state "deprecated" -}}

19
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@gethinode/hinode",
"version": "0.22.0-beta2",
"version": "0.22.0-beta5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@gethinode/hinode",
"version": "0.22.0-beta2",
"version": "0.22.0-beta5",
"license": "MIT",
"devDependencies": {
"@fullhuman/postcss-purgecss": "^5.0.0",
@@ -18,7 +18,7 @@
"eslint": "^8.56.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.5.0",
"eslint-plugin-n": "^16.6.0",
"eslint-plugin-promise": "^6.1.1",
"hugo-bin": "^0.118.0",
"markdownlint-cli2": "^0.11.0",
@@ -2986,15 +2986,16 @@
"dev": true
},
"node_modules/eslint-plugin-n": {
"version": "16.5.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.5.0.tgz",
"integrity": "sha512-Hw02Bj1QrZIlKyj471Tb1jSReTl4ghIMHGuBGiMVmw+s0jOPbI4CBuYpGbZr+tdQ+VAvSK6FDSta3J4ib/SKHQ==",
"version": "16.6.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.6.0.tgz",
"integrity": "sha512-Ag3tYFF90lYU8JdHEl9qSSpeLYbVnO+Oj7sgPUarWUacv1mPL3d5h5yG4Bv3tLe71hrcxmgTi7oByYwKXaVatw==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"builtins": "^5.0.1",
"eslint-plugin-es-x": "^7.5.0",
"get-tsconfig": "^4.7.0",
"globals": "^13.24.0",
"ignore": "^5.2.4",
"is-builtin-module": "^3.2.1",
"is-core-module": "^2.12.1",
@@ -4017,9 +4018,9 @@
}
},
"node_modules/globals": {
"version": "13.23.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz",
"integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==",
"version": "13.24.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dev": true,
"dependencies": {
"type-fest": "^0.20.2"

View File

@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.22.0-beta2",
"version": "0.22.0-beta5",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
@@ -76,7 +76,7 @@
"eslint": "^8.56.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.5.0",
"eslint-plugin-n": "^16.6.0",
"eslint-plugin-promise": "^6.1.1",
"hugo-bin": "^0.118.0",
"markdownlint-cli2": "^0.11.0",