mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-17 23:13:11 +00:00
Compare commits
12 Commits
v0.22.0-be
...
v0.22.0-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8300b9afee | ||
![]() |
5f61e74dfb | ||
![]() |
44b3ccd21e | ||
![]() |
29e54ce7ec | ||
![]() |
f2835209c6 | ||
![]() |
a0a1b8a9c0 | ||
![]() |
83f6ec1cb9 | ||
![]() |
af5b07202e | ||
![]() |
0bcfa59a12 | ||
![]() |
e00095f68d | ||
![]() |
5cbd2a1a82 | ||
![]() |
9b5a45a3f6 |
@@ -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
|
||||
|
@@ -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 }}
|
||||
|
||||
|
@@ -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-beta2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.22.0-beta",
|
||||
"version": "0.22.0-beta2",
|
||||
"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-beta2",
|
||||
"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