Compare commits

..

7 Commits

Author SHA1 Message Date
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
6 changed files with 31 additions and 19 deletions

View File

@@ -39,13 +39,18 @@ arguments:
optional: true
comment: Maximum number of cards to display.
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"
paginate:
type: bool
optional: true

View File

@@ -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

@@ -151,20 +151,20 @@
{{- $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
"icon" $icon
"thumbnail" $thumbnail
"ratio" $ratio
"description" $description
"color" $color
"loading" $loading
"max" $max
"cols" $cols
"href" $sectionURL
@@ -180,7 +180,6 @@
{{ else if eq $layout "nav" }}
{{- $partial = "assets/nav.html" -}}
{{- $params = merge $params (dict
"layout" $layout
"id" $section
"pane" $pane
"type" $type
@@ -192,6 +191,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)) }}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@gethinode/hinode",
"version": "0.22.0-beta2",
"version": "0.22.0-beta3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@gethinode/hinode",
"version": "0.22.0-beta2",
"version": "0.22.0-beta3",
"license": "MIT",
"devDependencies": {
"@fullhuman/postcss-purgecss": "^5.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.22.0-beta2",
"version": "0.22.0-beta3",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",