mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-17 06:53:11 +00:00
Compare commits
26 Commits
v0.22.0-be
...
v0.22.0-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
380ebcd1d8 | ||
![]() |
c06499033d | ||
![]() |
0874957993 | ||
![]() |
6019c7412f | ||
![]() |
30c300cabf | ||
![]() |
46f11f02ab | ||
![]() |
71e6029117 | ||
![]() |
5c67da7882 | ||
![]() |
af4f6de4b9 | ||
![]() |
9b173d6c68 | ||
![]() |
2f4fb5230d | ||
![]() |
9144a1fec3 | ||
![]() |
4192af1d46 | ||
![]() |
0e72124cdc | ||
![]() |
8300b9afee | ||
![]() |
5f61e74dfb | ||
![]() |
44b3ccd21e | ||
![]() |
29e54ce7ec | ||
![]() |
f2835209c6 | ||
![]() |
a0a1b8a9c0 | ||
![]() |
83f6ec1cb9 | ||
![]() |
af5b07202e | ||
![]() |
0bcfa59a12 | ||
![]() |
e00095f68d | ||
![]() |
5cbd2a1a82 | ||
![]() |
9b5a45a3f6 |
@@ -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',
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -20,6 +20,10 @@ arguments:
|
||||
- lg
|
||||
- xl
|
||||
- xxl
|
||||
class:
|
||||
type: string
|
||||
optional: true
|
||||
comment: Class attribute of the table element, e.g. “table-striped-columns w-auto”.
|
||||
body:
|
||||
type: string
|
||||
optional: false
|
||||
|
@@ -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',
|
||||
|
@@ -19,6 +19,7 @@
|
||||
"hr",
|
||||
"html",
|
||||
"i",
|
||||
"iframe",
|
||||
"img",
|
||||
"input",
|
||||
"li",
|
||||
@@ -39,14 +40,8 @@
|
||||
"sub",
|
||||
"sup",
|
||||
"svg",
|
||||
"table",
|
||||
"tbody",
|
||||
"td",
|
||||
"th",
|
||||
"thead",
|
||||
"time",
|
||||
"title",
|
||||
"tr",
|
||||
"ul",
|
||||
"use"
|
||||
],
|
||||
@@ -379,8 +374,6 @@
|
||||
"syntax-highlight",
|
||||
"tab-content",
|
||||
"tab-pane",
|
||||
"table",
|
||||
"table-responsive",
|
||||
"tag-link",
|
||||
"text-bg-body",
|
||||
"text-bg-body-tertiary",
|
||||
@@ -440,7 +433,8 @@
|
||||
"visually-hidden",
|
||||
"vr",
|
||||
"w-100",
|
||||
"w-50"
|
||||
"w-50",
|
||||
"youtube-embedded"
|
||||
],
|
||||
"ids": [
|
||||
"-theme",
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "card-group" "child" "card" "args" .) }}
|
||||
{{- errorf "partial [assets/card.html] - Invalid arguments" -}}
|
||||
{{- errorf "partial [assets/card-group.html] - Invalid arguments" -}}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments and default values -->
|
||||
|
@@ -30,7 +30,7 @@
|
||||
{{- $mode := .mode -}}
|
||||
{{- $title := .title -}}
|
||||
{{- $loading := .loading -}}
|
||||
{{- partial "assets/image.html" (dict "url" $thumbnail "title" $title "outerClass" $style "mode" $mode "loading" $loading) -}}
|
||||
{{- partial "assets/image.html" (dict "url" $thumbnail "title" $title "wrapper" $style "mode" $mode "loading" $loading) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $page := .page -}}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "nav" "args" . "group" "partial") }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ errorf "partial [assets/nav.html] - Invalid arguments" -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
"color" $color
|
||||
"content" (partial "utilities/GetDescription.html" $item)
|
||||
"thumbnail" $thumbnail
|
||||
"loading" $loading
|
||||
) -}}
|
||||
{{- else -}}
|
||||
{{ $illustration := (partial "utilities/GetIllustration.html" (dict "item" $item)) }}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "navbar" "args" . "group" "partial") }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ errorf "partial [assets/navbar.html] - Invalid arguments" -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "persona" "args" . "group" "partial") }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ errorf "partial [assets/persona.html] - Invalid arguments" -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{{- $content := .content -}}
|
||||
{{- $thumbnail := .thumbnail -}}
|
||||
|
||||
{{- $color := .color -}}
|
||||
{{- $color := .color | default "primary" -}}
|
||||
|
||||
{{- with $page -}}
|
||||
{{- if not $title }}{{ $title = .Title }}{{ end -}}
|
||||
|
@@ -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" }}
|
||||
@@ -148,23 +148,25 @@
|
||||
<div class="container-xxl {{ $wrapper }}">
|
||||
{{- partial "assets/section-header.html" $params -}}
|
||||
|
||||
{{ warnf "[%s] vertical: %t" $page.Title $vertical}}
|
||||
|
||||
{{- $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 +182,6 @@
|
||||
{{ else if eq $layout "nav" }}
|
||||
{{- $partial = "assets/nav.html" -}}
|
||||
{{- $params = merge $params (dict
|
||||
"layout" $layout
|
||||
"id" $section
|
||||
"pane" $pane
|
||||
"type" $type
|
||||
@@ -192,6 +193,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
|
||||
)
|
||||
-}}
|
||||
|
@@ -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)) }}
|
||||
|
@@ -22,10 +22,10 @@
|
||||
{{- $body := .Inner -}}
|
||||
{{- if $open -}}
|
||||
{{- $pattern := printf "data-bs-parent=\"#%s\"" $id -}}
|
||||
{{- $body = (replace .Inner $pattern "") | .Page.RenderString | safeHTML }}
|
||||
{{- $body = (replace .Inner $pattern "") }}
|
||||
{{- end -}}
|
||||
|
||||
<div id="{{ $id }}" class="accordion mb-3{{ with $class }} {{ . }}{{ end }}">
|
||||
{{- $body -}}
|
||||
{{- $body | safeHTML -}}
|
||||
</div>
|
||||
{{ end }}
|
@@ -31,18 +31,20 @@
|
||||
{{- if eq $lang "hugo" }}{{ $lang = "markdown" }}{{ end -}}
|
||||
|
||||
<!-- Main code -->
|
||||
<div class="rounded border mb-3">
|
||||
{{- if eq $show_preview true -}}
|
||||
<div {{ with $id }}id="{{ . }}"{{ end }} class="rounded-top p-3 {{ with $class }} {{ . }}{{ end }}">
|
||||
{{- $content | .Page.RenderString -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- if eq $show_markup true -}}
|
||||
<div class="d-flex align-items-center ps-3 pe-3 py-1{{ if $show_preview }} border-top{{ else }} rounded-top{{ end }} border-bottom syntax-highlight">
|
||||
<small class="font-monospace text-body text-uppercase">{{- $lang -}}</small>
|
||||
</div>
|
||||
<div class="rounded-bottom syntax-highlight border-none">
|
||||
{{- highlight (trim $content "\r\n") $lang "" -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ if not $error }}
|
||||
<div class="rounded border mb-3">
|
||||
{{- if eq $show_preview true -}}
|
||||
<div {{ with $id }}id="{{ . }}"{{ end }} class="rounded-top p-3 {{ with $class }} {{ . }}{{ end }}">
|
||||
{{- $content | .Page.RenderString | safeHTML -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- if eq $show_markup true -}}
|
||||
<div class="d-flex align-items-center ps-3 pe-3 py-1{{ if $show_preview }} border-top{{ else }} rounded-top{{ end }} border-bottom syntax-highlight">
|
||||
<small class="font-monospace text-body text-uppercase">{{- $lang -}}</small>
|
||||
</div>
|
||||
<div class="rounded-bottom syntax-highlight border-none">
|
||||
{{- highlight (trim $content "\r\n") $lang "" | safeHTML -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
{{ $error := false -}}
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "link" "args" .Params ) }}
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "kbd" "args" .Params ) }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
{{ $path := .Get "path" }}
|
||||
{{ $page := "" }}
|
||||
{{ if $path }}{{ $page = .Site.GetPage $path }}{{ end }}
|
||||
{{ if not $page }}
|
||||
{{ if and $path (not $page) }}
|
||||
{{ errorf "Cannot find page '%s': %s" $path .Position -}}
|
||||
{{ $error = true -}}
|
||||
{{ end }}
|
||||
|
@@ -13,30 +13,25 @@
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments -->
|
||||
{{- $responsiveVals := slice "none" "sm" "md" "lg" "xl" "xxl" -}}
|
||||
{{- $responsive := intersect .Params $responsiveVals -}}
|
||||
{{- $main := complement $responsive .Params -}}
|
||||
|
||||
{{- if in $responsive "none" -}}
|
||||
{{- $responsive = slice -}}
|
||||
{{- else if not $responsive -}}
|
||||
{{ $responsive = slice -}}
|
||||
{{- end -}}
|
||||
{{ $breakpoint := "" }}
|
||||
{{ $class := "" }}
|
||||
{{- if .IsNamedParams -}}
|
||||
{{ $breakpoint = .Get "breakpoint" }}
|
||||
{{ $class = .Get "class" | default "" }}
|
||||
{{ else }}
|
||||
{{ $breakpoint = .Get 0 }}
|
||||
{{ end }}
|
||||
{{ if eq $breakpoint "none" }}{{ $breakpoint = "" }}{{ end }}
|
||||
|
||||
<!-- Main code -->
|
||||
{{- $input := .Inner | .Page.RenderString }}
|
||||
{{- $input = replace $input "style=\"text-align:left\"" "class=\"text-start\"" -}}
|
||||
{{- $input = replace $input "style=\"text-align:center\"" "class=\"text-center\"" -}}
|
||||
{{- $input = replace $input "style=\"text-align:right\"" "class=\"text-end\"" -}}
|
||||
{{- $class := delimit $main " " -}}
|
||||
{{- $old := "<table>" -}}
|
||||
{{- $new := printf "<table class=\"table %s\">" $class -}}
|
||||
{{ $input := replace $input $old $new -}}
|
||||
{{ $attr := "" }}
|
||||
{{ range $responsive }}
|
||||
{{ $attr = printf "%s table-responsive-%s" $attr . }}
|
||||
{{ end }}
|
||||
|
||||
{{- if $responsive }}<div class="table-responsive {{ trim $attr " " }}">{{ end -}}
|
||||
<div class="{{- with $breakpoint }}table-responsive table-responsive-{{ . }}{{ end -}}">
|
||||
{{ $input | safeHTML }}
|
||||
{{- if $responsive }}</div>{{ end -}}
|
||||
</div>
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.22.0-beta",
|
||||
"version": "0.22.0-beta4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.22.0-beta",
|
||||
"version": "0.22.0-beta4",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@fullhuman/postcss-purgecss": "^5.0.0",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.22.0-beta",
|
||||
"version": "0.22.0-beta4",
|
||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||
"keywords": [
|
||||
"hugo",
|
||||
|
Reference in New Issue
Block a user