Compare commits

...

20 Commits

Author SHA1 Message Date
Mark Dumay
fad4cdbfd2 Merge pull request #221 from gethinode/develop
Sections
2023-04-24 15:00:20 +02:00
Mark Dumay
c403d422d9 Merge branch 'main' into develop 2023-04-24 14:52:03 +02:00
mark
0ecfa72864 Update section config 2023-04-24 14:51:00 +02:00
mark
62af498414 Refactor card group 2023-04-24 14:50:19 +02:00
mark
ee37599ded Fix card header and footer 2023-04-24 14:43:57 +02:00
mark
9a4c7c7776 Merge snippets and lists into sections 2023-04-24 14:17:37 +02:00
mark
c05eeb015c Bump release version 2023-04-24 14:09:23 +02:00
mark
d9f898a2e1 Add unique id to each nav 2023-04-24 06:54:01 +02:00
mark
36f31a57ae Fix id 2023-04-24 06:52:40 +02:00
mark
17b3bbaf80 Add body as supported color 2023-04-24 06:52:30 +02:00
mark
26bc4ebb00 Prioritize page title over param title 2023-04-24 04:52:17 +02:00
mark
d13d80af2f Adjust build timeout 2023-04-23 16:35:43 +02:00
Mark Dumay
64abaf8d1e Merge pull request #220 from gethinode/develop
Fixes
2023-04-23 14:55:05 +02:00
Mark Dumay
ffc9c47b45 Merge branch 'main' into develop 2023-04-23 14:43:04 +02:00
mark
092630b030 Fix layout of figures 2023-04-23 14:39:44 +02:00
mark
2ec60a8b71 Adjust top spacing 2023-04-23 14:39:03 +02:00
mark
9af871fee7 Align layout of tags to single page layout 2023-04-23 14:38:43 +02:00
mark
883ab3f7a0 Bump release version 2023-04-23 14:26:30 +02:00
mark
d6a49ccb90 Refine padding 2023-04-23 14:25:41 +02:00
mark
fdc58d52e9 Fix image caption when ratio is set 2023-04-23 13:55:30 +02:00
15 changed files with 188 additions and 230 deletions

View File

@@ -17,7 +17,7 @@ enableInlineShortcodes = true
ignoreErrors = ["error-remote-getjson"]
# toml-docs-start timeout
timeout = "60s"
timeout = "180s"
# toml-docs-end timeout
# toml-docs-start language

View File

@@ -34,12 +34,12 @@
sidebar = true
# toml-docs-end navigation
# toml-docs-start list
[list]
[blog]
# toml-docs-start sections
[sections]
[sections.blog]
title = "Blog"
sort = "date"
reverse = false
reverse = true
cols = 3
color = ""
padding = "0"
@@ -49,7 +49,7 @@
style = "border-0 card-zoom"
homepage = 3
separator = true
[projects]
[sections.projects]
title = "Projects"
sort = "title"
reverse = false
@@ -62,7 +62,7 @@
style = "border-1 card-emphasize"
homepage = 3
separator = false
# toml-docs-end list
# toml-docs-end sections
[favicon]
logo = "img/favicon.png"

View File

@@ -1,11 +1,11 @@
{{- define "partials/header.html" -}}
{{ if site.Params.navigation.breadcrumb }}{{ partial "breadcrumb.html" . }}{{ end -}}
{{ if in (slice "docs" "minimal") .Layout }}
{{ with .Title }}<p class="display-4 mt-3">{{ . }}</p>{{ end }}
{{ with .Title }}<p class="display-4 mt-5">{{ . }}</p>{{ end }}
{{ else }}
{{ $lastmodstr := (partial "utilities/date.html" (dict "date" .Lastmod "format" "long")) -}}
{{ $datestr := (partial "utilities/date.html" (dict "date" .Date "format" "long")) -}}
{{ with .Title }}<p class="display-4 mt-3">{{ . }}</p>{{ end }}
{{ with .Title }}<p class="display-4 mt-5">{{ . }}</p>{{ end }}
<small class="text-body-secondary text-uppercase">
{{ $datestr | i18n "postedOnDate" -}}
{{ if ne $datestr $lastmodstr -}}&nbsp;({{ $lastmodstr | i18n "lastModified" }}){{ end }} &bull;
@@ -92,7 +92,7 @@
</div>
</div>
<div class="container-xxl">
<div class="container-xxl px-3 px-xxl-0">
<div class="row row-cols-md-2 row-cols-lg-3">
<div class="col col-md-3 col-lg-2 d-none pt-5 d-md-block sidebar-overflow sticky-top">
{{ partial "assets/sidebar" (dict "page" . "menu" $menu "version" $version) }}
@@ -110,7 +110,7 @@
</div>
</div>
{{ else }}
<div class="container-xxl">
<div class="container-xxl px-3 px-xxl-0">
<div class="row row-cols-1 row-cols-sm-3">
<div class="col col-md-2 d-none d-md-block"></div>
<div class="col col-sm-12 col-md-8">

View File

@@ -8,8 +8,8 @@
{{- range $index, $section := site.Params.home.sections -}}
{{- $pages := where site.RegularPages "Type" "in" $section -}}
{{- $sectionURL := "" -}}
{{- range $page := first 1 $pages -}}
{{- $sectionURL = $page.Parent.RelPermalink -}}
{{- range $p := first 1 $pages -}}
{{- $sectionURL = $p.Parent.RelPermalink -}}
{{- end -}}
{{- $moreTitle := (T (printf "more%s" (strings.FirstUpper $section))) -}}
@@ -22,8 +22,4 @@
"sectionURL" $sectionURL)
-}}
{{- end -}}
{{- range $index, $section := site.Params.home.snippets -}}
{{- partial "assets/snippet-list.html" (dict "page" $page "section" $section) -}}
{{- end -}}
{{- end -}}

View File

@@ -34,9 +34,11 @@
{{- errorf "Invalid value for param 'page'" -}}
{{- end -}}
{{- $supportedTypes := slice "page.Pages" "resource.Resources" -}}
{{ $list := .list }}
{{- if ne (printf "%T" $list) "page.Pages" -}}
{{- errorf "Invalid value for param 'items'" -}}
{{- if not (in $supportedTypes (printf "%T" $list)) -}}
{{ warnf "Type: %T" $list }}
{{- errorf "Card-group - Invalid value for param 'list'" -}}
{{- end -}}
{{- $count := len $list -}}
@@ -87,56 +89,52 @@
{{- $footer := .footer -}}
{{- $orientation := .orientation -}}
<div class="container-fluid p-4">
<div class="container-fluid p-4 px-xxl-0">
{{ with $title }}<p class="display-4 mt-3{{ if and page.IsHome site.Params.home.centerHeadline }} text-center{{ end }}">{{ . }}</p>{{ end }}
{{ $paginator := "" }}
{{ if $paginate }}
<div class="row {{ $colGrid }}">
{{ $paginator := $page.Paginate $list }}
{{ range $index, $element := first $paginator.PageSize (after (mul (sub $paginator.PageNumber 1) $paginator.PageSize) $list) }}
<div class="col pt-3 pb-3">
{{- partial "assets/card.html" (dict
"path" $element.File.Path
"class" (printf "h-100 %s" $class)
"color" $color
"padding" $padding
"header" $header
"footer" $footer
"orientation" $orientation
)
-}}
{{ $paginator = $page.Paginate $list }}
{{ $list = first $paginator.PageSize (after (mul (sub $paginator.PageNumber 1) $paginator.PageSize) $list) }}
{{ end }}
<div class="row {{ $colGrid }}">
{{ range $index, $element := $list }}
{{- $params := (dict
"class" (printf "h-100 %s" $class)
"color" $color
"padding" $padding
"header" $header
"footer" $footer
"orientation" $orientation
) -}}
{{- if $element.IsPage -}}
{{- $params = merge $params (dict "path" $element.File.Path) -}}
{{- else -}}
{{- $params = merge $params (dict
"title" $element.Title
"href" (or $element.Permalink "#!")
"description" $element.Description
"thumbnail" $element.Params.thumbnail
"icon" $element.Params.icon
) -}}
{{- end -}}
<div class="col pt-3 pb-3">
{{- partial "assets/card.html" $params -}}
</div>
{{- if and (lt $index (sub $max 1)) $separator -}}
<div class="col d-block d-sm-none">
<hr>
</div>
{{- if and (lt $index (sub $max 1)) $separator -}}
<div class="col d-block d-sm-none">
<hr>
</div>
{{- end -}}
{{ end }}
</div>
{{- end -}}
{{- end -}}
</div>
{{ if $paginate }}
{{- if gt $paginator.TotalPages 1 -}}
{{- partial "assets/pagination.html" $page -}}
<div class="pt-3">{{ partial "assets/pagination.html" $page }}</div>
{{- end -}}
{{ else }}
<div class="row {{ $colGrid }}">
{{ range $index, $element := $list }}
<div class="col pt-3 pb-3">
{{- partial "assets/card.html" (dict
"path" $element.File.Path
"class" (printf "h-100 %s" $class)
"color" $color
"padding" $padding
"header" $header
"footer" $footer
"orientation" $orientation
)
-}}
</div>
{{- if and (lt $index (sub $max 1)) $separator -}}
<div class="col d-block d-sm-none">
<hr>
</div>
{{- end -}}
{{ end }}
</div>
{{ if gt $count $max }}
<a class="btn btn-outline-primary" href="{{ $moreURL| safeURL }}" role="button">{{ $moreTitle }}</a>
{{ end }}

View File

@@ -144,11 +144,11 @@
</div>
<div class="col-8">
<div class="card-body d-flex p-{{ $padding }} flex-column h-100">
<div>{{ partial "card-caption.html" (dict "page" $page "keywords" $header "color" $color) }}</div>
{{ if $page }}<div>{{ partial "card-caption.html" (dict "page" $page "keywords" $header "color" $color) }}</div>{{ end }}
<div class="h-100">
{{- partial "card-body.html" (dict "title" $title "href" $href "color" $color "description" $description) -}}
</div>
<div>{{ partial "card-caption.html" (dict "page" $page "keywords" $footer "color" $color) }}</div>
{{ if $page }}<div>{{ partial "card-caption.html" (dict "page" $page "keywords" $footer "color" $color) }}</div>{{ end }}
</div>
</div>
</div>
@@ -163,9 +163,9 @@
</div>
{{- end -}}
<div class="card-body d-flex flex-column p-{{ $padding }}">
{{- partial "card-caption.html" (dict "page" $page "keywords" $header "color" $color) -}}
{{ if $page }}{{- partial "card-caption.html" (dict "page" $page "keywords" $header "color" $color) -}}{{ end }}
{{- partial "card-body.html" (dict "title" $title "href" $href "color" $color "description" $description) -}}
{{- partial "card-caption.html" (dict "page" $page "keywords" $footer "color" $color) -}}
{{ if $page }}{{- partial "card-caption.html" (dict "page" $page "keywords" $footer "color" $color) -}}{{ end }}
</div>
</div>
{{- end -}}

View File

@@ -27,18 +27,19 @@
{{- define "partials/list-img.html" -}}
{{- $thumbnail := .thumbnail -}}
{{- $style := .style -}}
{{- partial "image.html" (dict "url" $thumbnail "outerClass" $style "mode" true) -}}
{{- $mode := .mode -}}
{{- partial "image.html" (dict "url" $thumbnail "outerClass" $style "mode" $mode) -}}
{{- end -}}
{{- $page := .page -}}
{{- if ne (printf "%T" $page) "*hugolib.pageState" -}}
{{- errorf "Invalid value for param 'page'" -}}
{{- errorf "partial [assets/list.html] - Invalid value for param 'page'" -}}
{{- end -}}
{{- $supportedTypes := slice "page.Pages" "resource.Resources" -}}
{{ $list := .list }}
{{- if ne (printf "%T" $list) "resource.Resources" -}}
{{- errorf "Invalid value for param 'items'" -}}
{{- if not (in $supportedTypes (printf "%T" $list)) -}}
{{- errorf "partial [assets/list.html] - Invalid value for param 'list'" -}}
{{- end -}}
{{- $title := .title -}}
@@ -47,7 +48,6 @@
{{ $vertical := false }}
{{ $type := "pills" }}
{{- $id := .Ordinal -}}
<div class="d-none d-md-block p-0">
{{- range $index, $item := $list -}}
@@ -64,10 +64,10 @@
{{- $style = "reveal fade-bottom-n5 rotate-n5 ps-3" -}}
{{- if $odd }}{{ $style = "reveal fade-bottom-5 rotate-5 pe-3" }}{{ end }}
{{ end }}
{{ partial "partials/list-img.html" (dict "thumbnail" $item.Params.Thumbnail "style" $style) }}
{{ partial "partials/list-img.html" (dict "thumbnail" $item.Params.Thumbnail "style" $style "mode" $item.Params.colormode) }}
</div>
<div class="col-6{{ if $odd }} order-first{{ end }} psw-lg-5 p-5">
{{ partial "partials/list-content.html" (dict "title" $item.Title "content" $item.Content )}}
{{ partial "partials/list-content.html" (dict "title" $item.Title "content" (or $item.Description $item.Content)) }}
</div>
</div>
</div>
@@ -83,10 +83,10 @@
{{ end }}
<div class="row pt-5 pb-5 align-items-center flex-fill row-cols-2">
<div class="col-12 text-center">
{{ partial "partials/list-img.html" (dict "thumbnail" $item.Params.Thumbnail)}}
{{ partial "partials/list-img.html" (dict "thumbnail" $item.Params.Thumbnail "mode" $item.Params.colormode) }}
</div>
<div class="col-12 p-3">
{{ partial "partials/list-content.html" (dict "title" $item.Title "content" $item.Content )}}
{{ partial "partials/list-content.html" (dict "title" $item.Title "content" (or $item.Description $item.Content)) }}
</div>
</div>
</div>

View File

@@ -19,9 +19,14 @@
{{- errorf "Invalid value for param 'page'" -}}
{{- end -}}
{{- $id := "0" -}}
{{- with .id -}}
{{ $id = . }}
{{ end }}
{{ $list := .list }}
{{- if ne (printf "%T" $list) "resource.Resources" -}}
{{- errorf "Invalid value for param 'items'" -}}
{{- errorf "Invalid value for param 'list'" -}}
{{- end -}}
{{- $title := .title -}}
@@ -30,33 +35,36 @@
{{ $vertical := false }}
{{ $type := "pills" }}
{{- $id := .Ordinal -}}
{{ if $vertical }}<div class="d-flex align-items-start">{{ end }}
<div class="nav{{ with $type }} nav-{{ . }}{{ end }}{{ with $class }} {{ . }}{{ end }}{{ if $vertical }} flex-column{{ end }}" id="nav-{{ $id }}" role="tablist"{{ if $vertical }} aria-orientation="vertical"{{ end }}>
{{- range $index, $item := $list -}}
{{ $show := eq $index 0}}
<button class="nav-link text-nowrap{{ if $show }} active{{ end }}" id="nav-{{ $id }}-btn-{{ $index }}" data-bs-toggle="pill" data-bs-target="#nav-{{ $id }}-{{ $index }}"
type="button" role="tab" aria-controls="nav-{{ $id }}-{{ $index }}" aria-selected="{{ if eq $index 0 }}true{{ else }}false{{ end }}">
{{ $item.Title }}
</button>
{{ end -}}
</div>
{{ with $title }}<p class="display-4 pt-5{{ if and page.IsHome site.Params.home.centerHeadline }} text-center{{ end }}">{{ . }}</p>{{ end }}
<div class="col-sm-12 col-md-10 col-lg-8 col-xl-6 mx-auto pt-5 pb-5">
<div class="tab-content {{ if eq $type "tabs" }}border border-top-0 p-3{{ else if $vertical }}ms-3{{ else }}mt-3{{ end }}">
{{ range $index, $item := $list }}
{{ $header := $item.Title }}
{{ $body := $item.Content }}
{{ $show := eq $index 0}}
<div class="tab-pane{{ if $show }} active{{ end }}" id="nav-{{ $id }}-{{ $index }}" role="tabpanel" aria-labelledby="{{ $id }}-btn-{{ $index }}" tabindex="0">
{{- partial "assets/persona.html" (dict
"title" $item.Title
"class" $class
"color" $color
"content" $item.Content
"thumbnail" $item.Params.Thumbnail
) -}}
</div>
{{ end }}
</div>
{{ if $vertical }}</div>{{ end }}
{{ if $vertical }}<div class="d-flex align-items-start">{{ end }}
<div class="nav{{ with $type }} nav-{{ . }}{{ end }}{{ with $class }} {{ . }}{{ end }}{{ if $vertical }} flex-column{{ end }}" id="nav-{{ $id }}" role="tablist"{{ if $vertical }} aria-orientation="vertical"{{ end }}>
{{- range $index, $item := $list -}}
{{ $show := eq $index 0}}
<button class="nav-link text-nowrap{{ if $show }} active{{ end }}" id="nav-{{ $id }}-btn-{{ $index }}" data-bs-toggle="pill" data-bs-target="#nav-{{ $id }}-{{ $index }}"
type="button" role="tab" aria-controls="nav-{{ $id }}-{{ $index }}" aria-selected="{{ if eq $index 0 }}true{{ else }}false{{ end }}">
{{ $item.Title }}
</button>
{{ end -}}
</div>
<div class="tab-content {{ if eq $type "tabs" }}border border-top-0 p-3{{ else if $vertical }}ms-3{{ else }}mt-3{{ end }}">
{{ range $index, $item := $list }}
{{ $header := $item.Title }}
{{ $body := $item.Content }}
{{ $show := eq $index 0}}
<div class="tab-pane{{ if $show }} active{{ end }}" id="nav-{{ $id }}-{{ $index }}" role="tabpanel" aria-labelledby="{{ $id }}-btn-{{ $index }}" tabindex="0">
{{- partial "assets/persona.html" (dict
"title" $item.Title
"class" $class
"color" $color
"content" $item.Content
"thumbnail" $item.Params.Thumbnail
) -}}
</div>
{{ end }}
</div>
{{ if $vertical }}</div>{{ end }}
</div>

View File

@@ -11,7 +11,7 @@
{{- $paginate := true -}}
{{- $sort := "date" -}}
{{- $reverse := true -}}
{{- $order := "desc" -}}
{{- $separator := false -}}
{{- $orientation := "stacked" -}}
{{- $cols := 3 -}}
@@ -22,11 +22,12 @@
{{- $style := "" -}}
{{- $homepage := 3 -}}
{{- $background := "" -}}
{{- $layout := "card" -}}
{{- with (index site.Params $section) -}}
{{- with index . "title" }}{{ $title = . }}{{ end -}}
{{- with (index site.Params.sections $section) -}}
{{- with index . "title" }}{{ $title = or $.title . }}{{ end -}}
{{- with index . "sort" }}{{ $sort = . }}{{ end -}}
{{- if (index . "reverse") }}{{ $reverse = true }}{{ else }}{{ $reverse = false }}{{ end -}}
{{- if (index . "reverse") }}{{ $order = "desc" }}{{ else }}{{ $order = "asc" }}{{ end -}}
{{- if (index . "separator") }}{{ $separator = true }}{{ else }}{{ $separator = false }}{{ end -}}
{{- with index . "orientation" }}{{ $orientation = . }}{{ end -}}
{{- with index . "cols" }}{{ $cols = . }}{{ end -}}
@@ -37,53 +38,72 @@
{{- with index . "style" }}{{ $style = . }}{{ end -}}
{{- with index . "homepage" }}{{ $homepage = . }}{{ end -}}
{{- with index . "background" }}{{ $background = . }}{{ end -}}
{{- with index . "layout" }}{{ $layout = . }}{{ end -}}
{{- end -}}
{{- $list := where site.RegularPages "Type" "in" $section -}}
{{- $max := (len $list) -}}
{{- if $home -}}
{{- $paginate = false -}}
{{- $max = int (math.Min $homepage $max) -}}
{{ end -}}
{{ $list := where site.RegularPages "Type" "in" $section }}
{{ $max := (len $list) -}}
{{ if eq $max 0 }}
{{- $bundle := site.GetPage $section -}}
{{- $list = $bundle.Resources.Match "*" -}}
{{- $max = len $list -}}
{{ end }}
{{- $list = sort $list (printf "Params.%s" $sort) $order -}}
{{- $cols = int (math.Min $cols $max) -}}
{{- if eq $sort "weight" -}}
{{- $list = $list.ByWeight -}}
{{- else if eq $sort "publication" -}}
{{- $list = $list.ByPublishDate -}}
{{- else if eq $sort "expiration" -}}
{{- $list = $list.ByExpiryDate -}}
{{- else if eq $sort "lastmod" -}}
{{- $list = $list.ByLastmod -}}
{{- else if eq $sort "length" -}}
{{- $list = $list.ByLength -}}
{{- else if eq $sort "title" -}}
{{- $list = $list.ByTitle -}}
{{- else if eq $sort "linktitle" -}}
{{- $list = $list.ByLinkTitle -}}
{{- else if ne $sort "date" -}}
{{- $list = $list.ByParam $sort -}}
{{- $supportedLayouts := slice "card" "list" "nav" -}}
{{- if not (in $supportedLayouts $layout) -}}
{{- errorf "partial [assets/section-list.html] - Invalid value for param 'layout': %s" $layout -}}
{{- end -}}
{{- if $reverse -}}{{- $list = $list.Reverse -}}{{ end -}}
<div class="container-xxl flex-fill p-0{{ with $background }} bg-{{ . }}{{ end }}">
{{- partial "assets/card-group.html" (dict
{{ if gt $max 0 }}
{{- if $home -}}
{{- $paginate = false -}}
{{- $max = int (math.Min $homepage $max) -}}
{{ end -}}
{{- $cols = int (math.Min $cols $max) -}}
{{- $params := (dict
"page" $page
"list" $list
"max" $max
"cols" $cols
"title" $title
"href" $sectionURL
"hrefTitle" $moreTitle
"separator" $separator
"paginate" $paginate
"class" $style
"orientation" $orientation
"color" $color
"padding" $padding
"header" $header
"footer" $footer
)
)
-}}
</div>
{{- $partial := "" -}}
<div class="container-fluid {{ with $background }} bg-{{ . }}{{ end }}">
<div class="container-xxl flex-fill p-0">
{{ if eq $layout "card" }}
{{- $partial = "assets/card-group.html" -}}
{{- $params = merge $params (dict
"max" $max
"cols" $cols
"href" $sectionURL
"hrefTitle" $moreTitle
"separator" $separator
"paginate" $paginate
"orientation" $orientation
"padding" $padding
"header" $header
"footer" $footer
)
-}}
{{ else if eq $layout "nav" }}
{{- $partial = "assets/nav.html" -}}
{{- $params = merge $params (dict
"layout" $layout
"id" $section
)
-}}
{{- else -}}
{{- $partial = "assets/list.html" -}}
{{- $params = merge $params (dict
"layout" $layout
)
-}}
{{- end -}}
{{- partial $partial $params -}}
</div>
</div>
{{- end -}}

View File

@@ -1,58 +0,0 @@
{{- $page := .page }}
{{- $section := .section }}
{{- if not $section }}{{ errorf "Missing value for param 'section'" }}{{ end -}}
{{- $bundle := site.GetPage $section -}}
{{- $title := $bundle.Title -}}
{{- $sort := "date" -}}
{{- $order := "desc" -}}
{{- $style := "" -}}
{{- $background := "" -}}
{{- $color := "" -}}
{{- $layout := "tabs" -}}
{{- with (index site.Params $section) -}}
{{- with index . "title" }}{{ $title = . }}{{ end -}}
{{- with index . "sort" }}{{ $sort = . }}{{ end -}}
{{- if (index . "reverse") }}{{ $order = "desc" }}{{ else }}{{ $order = "asc" }}{{ end -}}
{{- with index . "style" }}{{ $style = . }}{{ end -}}
{{- with index . "background" }}{{ $background = . }}{{ end -}}
{{- with index . "color" }}{{ $color = . }}{{ end -}}
{{- with index . "layout" }}{{ $layout = . }}{{ end -}}
{{- end -}}
{{- $list := $bundle.Resources.Match "*" -}}
{{- $list = sort $list (printf "Params.%s" $sort) $order -}}
<div class="container-fluid {{ with $background }} bg-{{ . }}{{ end }}">
<div class="container-xxl flex-fill p-0">
{{ if eq $layout "tabs" }}
<div class="p-0">
{{ with $title }}<p class="display-4 pt-5{{ if and page.IsHome site.Params.home.centerHeadline }} text-center{{ end }}">{{ . }}</p>{{ end }}
<div class="col-sm-12 col-md-10 col-lg-8 col-xl-6 mx-auto pt-5 pb-5">
{{- partial "assets/nav.html" (dict
"page" $page
"list" $list
"title" $title
"class" $style
"color" $color
"layout" $layout
)
-}}
</div>
</div>
{{- else -}}
<div class=" p-0">
{{- partial "assets/list.html" (dict
"page" $page
"list" $list
"title" $title
"class" $style
"color" $color
"layout" $layout
)
-}}
</div>
{{- end -}}
</div>
</div>

View File

@@ -132,23 +132,14 @@
{{- range $none := $modes -}}
{{- if ne $none $mode -}}
{{- $outerClass = printf "%s d-none-%s" $outerClass $none -}}
{{- $outerClass = printf "%s d-none-%s" (or $outerClass "") $none -}}
{{- end -}}
{{- end -}}
{{- if $caption -}}
<figure class="figure {{ $outerClass }}">
<img class="figure-img img-fluid {{ $innerClass }}"
{{ with $imgset -}}
srcset="{{ . }}"
sizes="100vw"
{{- end }}
src="{{ $fallbackURL }}"
alt="{{ $title }}">
<figcaption class="figure-caption">{{ $caption | safeHTML }}</figcaption>
</figure>
{{- else -}}
<div class="{{ with $ratio }}ratio ratio-{{ . }}{{ end }} {{ $outerClass }}">
<figure {{ with $outerClass }}class="{{ . }}"{{ end }}>
{{ end }}
<div class="{{ with $ratio }}ratio ratio-{{ . }}{{ end }}{{ if not $caption }} {{ $outerClass }}{{ end }}">
<img class="img-fluid {{ $innerClass }}"
{{ with $imgset -}}
srcset="{{ . }}"
@@ -157,7 +148,10 @@
src="{{ $fallbackURL }}"
alt="{{ $title }}">
</div>
{{- end -}}
{{- if $caption -}}
<figcaption class="figure-caption">{{ $caption | safeHTML }}</figcaption>
</figure>
{{- end -}}
{{- end -}}
<!-- Initiate the regular or color-mode image -->

View File

@@ -3,8 +3,8 @@
"path" Required path of the page.
"class" Optional class attribute of the card element, e.g. “w-50”.
"color": Optional theme color of the card, either "primary", "secondary", "success", "danger",
"warning", "info", "light", "dark", "white", "black", or "body-tertiary". By default, no color
is specified.
"warning", "info", "light", "dark", "white", "black", "body", or "body-tertiary". By default, no
color is specified.
-->
{{- $error := false -}}
@@ -21,7 +21,7 @@
{{- $color := "" -}}
{{- with .Get "color" }}{{ $color = . }}{{ end -}}
{{- if $color -}}
{{- $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" "white" "black" "body-tertiary" -}}
{{- $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" "white" "black" "body" "body-tertiary" -}}
{{- if not (in $supportedColors $color) -}}
{{- errorf "Invalid value for param 'color': %s" .Position -}}
{{- $error = true -}}

View File

@@ -1,9 +1,9 @@
{{ define "main" }}
<div class="container-fluid">
<div class="row row-cols-1 row-cols-sm-3 align-items-center p-3">
<div class="container-xxl px-3 px-xxl-0">
<div class="row row-cols-1 row-cols-sm-3">
<div class="col col-md-2 d-none d-md-block"></div>
<div class="col col-sm-12 col-md-8">
<p class="display-4">{{ .Name | humanize }}</p>
<p class="display-4 mt-5">{{ .Name | humanize }}</p>
{{ if eq .Kind "taxonomy" }}
<div class="row mt-5"></div>

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@gethinode/hinode",
"version": "0.12.0-alpha3",
"version": "0.12.0-alpha5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@gethinode/hinode",
"version": "0.12.0-alpha3",
"version": "0.12.0-alpha5",
"license": "MIT",
"devDependencies": {
"@fortawesome/fontawesome-free": "^6.4.0",

View File

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