mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-07 10:04:22 +00:00
Compare commits
106 Commits
v0.21.6
...
v0.22.0-al
Author | SHA1 | Date | |
---|---|---|---|
![]() |
daab751299 | ||
![]() |
9e82ff8de5 | ||
![]() |
52b2c23565 | ||
![]() |
617fd688db | ||
![]() |
2cf7fff3ba | ||
![]() |
a34d3fde1f | ||
![]() |
be054a723e | ||
![]() |
fc43f6a52e | ||
![]() |
195d3cb69b | ||
![]() |
92c69b6011 | ||
![]() |
ea78805587 | ||
![]() |
76e90ea321 | ||
![]() |
b300758aa5 | ||
![]() |
68c44c55d4 | ||
![]() |
228a89f61d | ||
![]() |
2645453de2 | ||
![]() |
5ce069a4c0 | ||
![]() |
6661434c35 | ||
![]() |
aee6b3a32d | ||
![]() |
4b0cc260cb | ||
![]() |
7611315941 | ||
![]() |
3b1f71a601 | ||
![]() |
fead3555fc | ||
![]() |
cd3f99fc90 | ||
![]() |
a2e6855117 | ||
![]() |
1e4cd3a5da | ||
![]() |
865898ac4f | ||
![]() |
44ace26cde | ||
![]() |
d0350c7672 | ||
![]() |
943a115ef0 | ||
![]() |
745322b3fe | ||
![]() |
90ea2cb760 | ||
![]() |
2d6c3c7d64 | ||
![]() |
4401c49c54 | ||
![]() |
fa3bfa7008 | ||
![]() |
14c2ddc725 | ||
![]() |
1e55dc8f65 | ||
![]() |
78980dde3f | ||
![]() |
3a770b6f40 | ||
![]() |
b271adef3f | ||
![]() |
639c9770b8 | ||
![]() |
e6b29666ad | ||
![]() |
dd052250f6 | ||
![]() |
1223a22d7e | ||
![]() |
b6f034f8e3 | ||
![]() |
ca01b67396 | ||
![]() |
eb3a2b0bb1 | ||
![]() |
41711fb527 | ||
![]() |
6e7a9a8796 | ||
![]() |
92838c0572 | ||
![]() |
3f71da19ee | ||
![]() |
43a6dd2b79 | ||
![]() |
806fac97db | ||
![]() |
9fd07827db | ||
![]() |
28cdcec7ee | ||
![]() |
cb2e946435 | ||
![]() |
2e7bb50d43 | ||
![]() |
3d7875ba18 | ||
![]() |
29ab88d581 | ||
![]() |
d93bbe4fe3 | ||
![]() |
3a2d062e22 | ||
![]() |
c3ef897a71 | ||
![]() |
73964e6be4 | ||
![]() |
520c000d3b | ||
![]() |
e3c1db7b88 | ||
![]() |
9ba3218f61 | ||
![]() |
a912d65608 | ||
![]() |
ffd6bb9c46 | ||
![]() |
6a238c3a11 | ||
![]() |
3210d72068 | ||
![]() |
add57592cd | ||
![]() |
584131c8c4 | ||
![]() |
9e8a1b4e3d | ||
![]() |
61efc2de16 | ||
![]() |
ce1f688b38 | ||
![]() |
088464bf13 | ||
![]() |
936ca3ffc2 | ||
![]() |
4f6320f7cf | ||
![]() |
ccf3169381 | ||
![]() |
54d66d2b02 | ||
![]() |
25aeb94364 | ||
![]() |
5657ef5b40 | ||
![]() |
c8818d104f | ||
![]() |
ed239034bf | ||
![]() |
774f936d3b | ||
![]() |
905c28886a | ||
![]() |
ad430074f7 | ||
![]() |
6449f01185 | ||
![]() |
0c3488472c | ||
![]() |
ee7990ec1e | ||
![]() |
b892b48388 | ||
![]() |
340213e4ff | ||
![]() |
989f2eed4c | ||
![]() |
4fadb7a6ab | ||
![]() |
8f1fd120eb | ||
![]() |
f2fc3b60a4 | ||
![]() |
c0735f71ef | ||
![]() |
858f9b3430 | ||
![]() |
402a7a85b8 | ||
![]() |
97fbc6087c | ||
![]() |
cc4a4766a9 | ||
![]() |
6821ac2b60 | ||
![]() |
06e10655ec | ||
![]() |
d32fdfa987 | ||
![]() |
9e97f063e5 | ||
![]() |
627f174ae4 |
36
README.md
36
README.md
@@ -9,32 +9,32 @@
|
||||
|
||||
<!-- Badges -->
|
||||
<p align="center">
|
||||
<a href="https://gohugo.io" alt="Hugo website">
|
||||
<img src="https://img.shields.io/badge/generator-hugo-brightgreen">
|
||||
<a href="https://gohugo.io">
|
||||
<img src="https://img.shields.io/badge/generator-hugo-brightgreen" alt="Hugo website">
|
||||
</a>
|
||||
<a href="https://gethinode.com" alt="Hinode theme">
|
||||
<img src="https://img.shields.io/badge/theme-hinode-blue">
|
||||
<a href="https://gethinode.com">
|
||||
<img src="https://img.shields.io/badge/theme-hinode-blue" alt="Hinode theme">
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/%40gethinode/hinode" alt="npm package">
|
||||
<img src="https://img.shields.io/npm/v/%40gethinode/hinode">
|
||||
<a href="https://www.npmjs.com/package/%40gethinode/hinode">
|
||||
<img src="https://img.shields.io/npm/v/%40gethinode/hinode" alt="npm package">
|
||||
</a>
|
||||
<a href="https://app.netlify.com/sites/gethinode-demo/deploys" alt="Netlify Status">
|
||||
<img src="https://img.shields.io/netlify/0ad42e3e-fdfa-4d37-8e26-58badd429a67">
|
||||
<a href="https://app.netlify.com/sites/gethinode-demo/deploys">
|
||||
<img src="https://img.shields.io/netlify/0ad42e3e-fdfa-4d37-8e26-58badd429a67" alt="Netlify Status">
|
||||
</a>
|
||||
<a href="https://stats.uptimerobot.com/xyGVYhLJmV" alt="UptimeRobot Status">
|
||||
<img src="https://img.shields.io/uptimerobot/status/m791334689-73d9dfc82030f4f955b2d6bb">
|
||||
<a href="https://stats.uptimerobot.com/xyGVYhLJmV">
|
||||
<img src="https://img.shields.io/uptimerobot/status/m791334689-73d9dfc82030f4f955b2d6bb" alt="UptimeRobot Status">
|
||||
</a>
|
||||
<a href="https://github.com/gethinode/hinode/commits/main" alt="Last commit">
|
||||
<img src="https://img.shields.io/github/last-commit/gethinode/hinode.svg">
|
||||
<a href="https://github.com/gethinode/hinode/commits/main">
|
||||
<img src="https://img.shields.io/github/last-commit/gethinode/hinode.svg" alt="Last commit">
|
||||
</a>
|
||||
<a href="https://github.com/gethinode/hinode/issues" alt="Issues">
|
||||
<img src="https://img.shields.io/github/issues/gethinode/hinode.svg">
|
||||
<a href="https://github.com/gethinode/hinode/issues">
|
||||
<img src="https://img.shields.io/github/issues/gethinode/hinode.svg" alt="Issues">
|
||||
</a>
|
||||
<a href="https://github.com/gethinode/hinode/pulls" alt="Pulls">
|
||||
<img src="https://img.shields.io/github/issues-pr-raw/gethinode/hinode.svg">
|
||||
<a href="https://github.com/gethinode/hinode/pulls">
|
||||
<img src="https://img.shields.io/github/issues-pr-raw/gethinode/hinode.svg" alt="Pulls">
|
||||
</a>
|
||||
<a href="https://github.com/gethinode/hinode/blob/main/LICENSE" alt="License">
|
||||
<img src="https://img.shields.io/github/license/gethinode/hinode">
|
||||
<a href="https://github.com/gethinode/hinode/blob/main/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/gethinode/hinode" alt="License">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
@@ -104,6 +104,9 @@ home = ["HTML", "RSS", "REDIR"]
|
||||
[[module.mounts]]
|
||||
source = "content"
|
||||
target = "content"
|
||||
[[module.mounts]]
|
||||
source = "data"
|
||||
target = "data"
|
||||
[[module.mounts]]
|
||||
source = "i18n"
|
||||
target = "i18n"
|
||||
|
@@ -8,6 +8,7 @@
|
||||
endorse = true
|
||||
footerBelowFold = false
|
||||
loading = "lazy"
|
||||
breakpoint = "md"
|
||||
[main.externalLinks]
|
||||
cue = false
|
||||
tab = false
|
||||
|
33
data/structures/abbr.yml
Normal file
33
data/structures/abbr.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
comment: >-
|
||||
Creates an HTML element that shows the long form of an abbrevitation. The abbreviation data is centrally stored in a
|
||||
data file. By default, the shortcode uses "abbr.yaml" with translation support.
|
||||
|
||||
The data file is expected to store key-value pairs, where "id" is the lower-case abbrevation and "long" its long
|
||||
form. The following example illustrates this using YML:
|
||||
|
||||
- id: css
|
||||
long: "Cascading Style Sheets"
|
||||
arguments:
|
||||
key:
|
||||
type: string
|
||||
position: 0
|
||||
optional: false
|
||||
comment: >-
|
||||
Case-insensitive key of the abbreviation. In shorthand notation, this is
|
||||
the first (and only) matched argument. Non-alphanumeric keys must be quoted.
|
||||
data:
|
||||
type: string
|
||||
default: abbr.yaml
|
||||
optional: true
|
||||
comment: >-
|
||||
Filename of the abbrevation input. You can omit the file extension. The
|
||||
file should reside in the "data" folder. The data supports language
|
||||
extensions. For example, "abbr.en.yaml" refers to the English translation
|
||||
of the abbrevation data. The filename "abbr.yaml" is used when no suitable
|
||||
translation is found.
|
||||
class:
|
||||
type: string
|
||||
optional: true
|
||||
comment: >-
|
||||
Class attribute of the abbr element. For example, specify "initialism" for
|
||||
a slightly smaller font size.
|
23
data/structures/accordion-item.yml
Normal file
23
data/structures/accordion-item.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
comment: >-
|
||||
Defines an individual accordion item.
|
||||
arguments:
|
||||
header:
|
||||
type: string
|
||||
optional: false
|
||||
comment: >-
|
||||
Header of the accordion item.
|
||||
show:
|
||||
type: bool
|
||||
optional: true
|
||||
comment: >-
|
||||
flag to indicate an item should be shown as collapsed.
|
||||
class:
|
||||
type: string
|
||||
optional: true
|
||||
comment: >-
|
||||
Class attribute of the accordion item.
|
||||
body:
|
||||
optional: false
|
||||
comment: >-
|
||||
Content of the accordion item.
|
||||
group: shortcode
|
19
data/structures/accordion.yml
Normal file
19
data/structures/accordion.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
comment: >-
|
||||
Use the accordion to show a group of vertically collapsing and expanding
|
||||
items. Add accordion-item inner elements for each accordion item.
|
||||
arguments:
|
||||
id:
|
||||
type: string
|
||||
optional: true
|
||||
comment: >-
|
||||
ID of the accordion, defaults to “accordion-n” with a sequential number n.
|
||||
always-open:
|
||||
type: bool
|
||||
optional: true
|
||||
comment: >-
|
||||
Flag to make accordion items stay open when another item is opened.
|
||||
class:
|
||||
type: string
|
||||
optional: true
|
||||
comment: >-
|
||||
Class attribute of the accordion, e.g. “w-50”.
|
52
data/structures/alert.yml
Normal file
52
data/structures/alert.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
comment: >-
|
||||
Use the alert shortcode to display a contextual feedback message. The inner
|
||||
content is used as alert text.
|
||||
arguments:
|
||||
class:
|
||||
type: string
|
||||
optional: true
|
||||
comment: >-
|
||||
Class attribute of the alert element.
|
||||
color:
|
||||
type: select
|
||||
optional: true
|
||||
default: danger
|
||||
comment: >-
|
||||
Theme color of the alert.
|
||||
options:
|
||||
values:
|
||||
- primary
|
||||
- secondary
|
||||
- success
|
||||
- danger
|
||||
- warning
|
||||
- info
|
||||
- light
|
||||
- dark
|
||||
- white
|
||||
- black
|
||||
dismissible:
|
||||
type: bool
|
||||
optional: true
|
||||
default: false
|
||||
comment: >-
|
||||
Flag to indicate the alert is dismissible.
|
||||
icon:
|
||||
type: string
|
||||
optional: true
|
||||
comment: >-
|
||||
Font Awesome icon to include.
|
||||
type:
|
||||
type: select
|
||||
optional: true
|
||||
comment: >-
|
||||
Type of the alert, generates an alert with related color and icon.
|
||||
options:
|
||||
values:
|
||||
- danger
|
||||
- info
|
||||
body:
|
||||
optional: false
|
||||
comment: >-
|
||||
Alert text.
|
||||
group: shortcode
|
20
data/structures/args.yml
Normal file
20
data/structures/args.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
comment: >-
|
||||
Generates a markdown table of structured arguments. The argument definitions are
|
||||
expected to be defined in a data file identified by a provided structure name.
|
||||
arguments:
|
||||
structure:
|
||||
type: string
|
||||
position: 0
|
||||
optional: false
|
||||
comment: >-
|
||||
Name of the data file that contains argument definitions. Supported data
|
||||
formats include JSON, TOML, YAML, and XML. You can omit the file
|
||||
extension. The file should reside in the "data/structures" folder.
|
||||
group:
|
||||
type: string
|
||||
position: 1
|
||||
optional: true
|
||||
comment: >-
|
||||
Name of the group filter. This is typically used when a shortcode and
|
||||
partial have common arguments. The group filter binds a specific argument
|
||||
to a particular group. By default, an argument belongs to all groups.
|
175
data/structures/card.yml
Normal file
175
data/structures/card.yml
Normal file
@@ -0,0 +1,175 @@
|
||||
comment: >-
|
||||
Displays a Bootstrap card. Either specify a valid path, or set the arguments
|
||||
title, href, header, description, and thumbnail individually. The latter
|
||||
arguments override any page attributes.
|
||||
arguments:
|
||||
title:
|
||||
type: string
|
||||
optional: true
|
||||
comment: >-
|
||||
Title of the card, replaces the title of the referenced page (if any).
|
||||
path:
|
||||
type: path
|
||||
optional: true
|
||||
comment: >-
|
||||
Path of the page that the card reference to. If omitted, specify the
|
||||
title, icon, thumbnail, and description (inner content) as needed.
|
||||
href:
|
||||
type: url
|
||||
optional: true
|
||||
comment: >-
|
||||
Address for the button or hyperlink.
|
||||
group: partial
|
||||
class:
|
||||
type: string
|
||||
optional: true
|
||||
parent: merge
|
||||
comment: >-
|
||||
Class attribute of the card element, e.g. “w-50”.
|
||||
color:
|
||||
type: select
|
||||
optional: true
|
||||
parent: cascade
|
||||
comment: >-
|
||||
Theme color of the card. By default, no color is specified.
|
||||
options:
|
||||
values:
|
||||
- primary
|
||||
- secondary
|
||||
- success
|
||||
- danger
|
||||
- warning
|
||||
- info
|
||||
- light
|
||||
- dark
|
||||
- white
|
||||
- black
|
||||
- body
|
||||
- body-tertiary
|
||||
padding:
|
||||
type: select
|
||||
optional: true
|
||||
default: auto
|
||||
parent: cascade
|
||||
comment: >-
|
||||
Padding of the content.
|
||||
options:
|
||||
values:
|
||||
- "0"
|
||||
- "1"
|
||||
- "2"
|
||||
- "3"
|
||||
- "4"
|
||||
- "5"
|
||||
- "auto"
|
||||
gutter:
|
||||
type: select
|
||||
optional: true
|
||||
default: "0"
|
||||
parent: cascade
|
||||
comment: >-
|
||||
Gutter between columns in a group.
|
||||
options:
|
||||
values:
|
||||
- "0"
|
||||
- "1"
|
||||
- "2"
|
||||
- "3"
|
||||
- "4"
|
||||
- "5"
|
||||
header:
|
||||
type: select
|
||||
optional: true
|
||||
default: full
|
||||
parent: cascade
|
||||
comment: >-
|
||||
Header components of the card, displayed in small caps.
|
||||
options:
|
||||
values:
|
||||
- full
|
||||
- publication
|
||||
- tags
|
||||
- none
|
||||
footer:
|
||||
type: select
|
||||
optional: true
|
||||
default: none
|
||||
parent: cascade
|
||||
comment: >-
|
||||
Footer components of the card, displayed in small caps.
|
||||
options:
|
||||
values:
|
||||
- full
|
||||
- publication
|
||||
- tags
|
||||
- none
|
||||
description:
|
||||
type:
|
||||
- string
|
||||
- template.HTML
|
||||
optional: true
|
||||
comment: >-
|
||||
Description of the card.
|
||||
group: partial
|
||||
loading:
|
||||
type: select
|
||||
optional: true
|
||||
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
|
||||
should reduce the initial loading time of the website. It is recommended
|
||||
to lazily load only those images that are below the page fold.
|
||||
options:
|
||||
values:
|
||||
- lazy
|
||||
- eager
|
||||
group: partial
|
||||
thumbnail:
|
||||
type: path
|
||||
optional: true
|
||||
comment: >-
|
||||
Thumbnail image url, displayed on top or the left of the card.
|
||||
ratio:
|
||||
type: select
|
||||
optional: true
|
||||
comment: >-
|
||||
Ratio of the thumbnail image, defaults to "16x9" (stacked orientation)
|
||||
or "1x1" (horizontal orientation).
|
||||
options:
|
||||
values:
|
||||
- 1x1
|
||||
- 3x2
|
||||
- 4x3
|
||||
- 16x9
|
||||
- 21x9
|
||||
group: partial
|
||||
alt:
|
||||
type: string
|
||||
optional: true
|
||||
release: v0.19.0
|
||||
comment: >-
|
||||
Alternate text for the thumbnail, uses "title" by default.
|
||||
icon:
|
||||
type: string
|
||||
optional: true
|
||||
comment: >-
|
||||
Font Awesome icon, displayed on top or the left of the card.
|
||||
orientation:
|
||||
type: select
|
||||
optional: true
|
||||
default: stacked
|
||||
parent: cascade
|
||||
comment: >-
|
||||
Placement of the thumbnail or icon.
|
||||
options:
|
||||
values:
|
||||
- stacked
|
||||
- horizontal
|
||||
- horizontal-sm
|
||||
- none
|
||||
body:
|
||||
optional: true
|
||||
comment: >-
|
||||
Description of the card.
|
||||
group: shortcode
|
@@ -6,6 +6,7 @@
|
||||
canonifyAssetsURLs = false
|
||||
footerBelowFold = false
|
||||
loading = "lazy"
|
||||
breakpoint = "md"
|
||||
[main.externalLinks]
|
||||
cue = true
|
||||
tab = true
|
||||
|
@@ -1,9 +1,10 @@
|
||||
---
|
||||
author: Mark Dumay
|
||||
title: Fourth post
|
||||
title: Fourth post (excluded from search)
|
||||
date: 2023-01-01
|
||||
description: This is my fourth blog post.
|
||||
description: This is my fourth blog post. It is excluded from the search index.
|
||||
tags: ["blog"]
|
||||
searchExclude: true
|
||||
thumbnail:
|
||||
url: img/flowers.jpg
|
||||
author: Arvee Marie
|
||||
|
@@ -18,6 +18,10 @@ github.com/gethinode/mod-flexsearch v1.5.1 h1:9fYlnHgiEXckL0EoC0zlSNO7BWZf5yiOro
|
||||
github.com/gethinode/mod-flexsearch v1.5.1/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-flexsearch v1.6.0 h1:Rjx+GLOByFLmaWD9hZXwmuKN8A89te6BZAIq2c9QBKg=
|
||||
github.com/gethinode/mod-flexsearch v1.6.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-flexsearch v1.7.0 h1:VFTf6iUyT9b47jTDAxh8nVHU1eUBrdxlykaC90lTfqk=
|
||||
github.com/gethinode/mod-flexsearch v1.7.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-flexsearch v1.7.1 h1:f4rjKkhleDVzqwUmwP1xZdhjru5VQ9g0MRDz0G6oLyY=
|
||||
github.com/gethinode/mod-flexsearch v1.7.1/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-fontawesome v1.2.4 h1:SqE3CQ+boaBIhrVh3MPu4nz0uoHPfEH5t60nNY1CfsI=
|
||||
github.com/gethinode/mod-fontawesome v1.2.4/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-fontawesome v1.2.5 h1:RqkLRj6+s+gM4nKd0IwNMMDA8cRmxfp0fxkVH4FdAGU=
|
||||
@@ -34,6 +38,10 @@ github.com/gethinode/mod-fontawesome v1.5.0 h1:3mW5dnWauuF9wSWXNIY+PPgTNPlc/xQOQ
|
||||
github.com/gethinode/mod-fontawesome v1.5.0/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-fontawesome v1.5.1 h1:C7goQY4HrEua/lpjC++laydNKBuYo1+307ngn5tyXeM=
|
||||
github.com/gethinode/mod-fontawesome v1.5.1/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-fontawesome v1.6.1 h1:iqOgDGdw7Bs4hnzjF/8JsUn10omyKQZTglLqNenT1K0=
|
||||
github.com/gethinode/mod-fontawesome v1.6.1/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-fontawesome v1.7.3 h1:YzRCYSasVRIcImVmTJYjqNJ+KmyNWfm/bMgtM0slvzs=
|
||||
github.com/gethinode/mod-fontawesome v1.7.3/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-katex v1.0.1/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.0.2 h1:pIG4n3qLl/IVe7BEiwn+GL8r5lOCtF6FDxlcrPKdAXk=
|
||||
github.com/gethinode/mod-katex v1.0.2/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
@@ -41,6 +49,8 @@ github.com/gethinode/mod-katex v1.0.3 h1:fvlUWqcUQqv2zRNM2kfmJ6GhXA816Tl1nfVrUkm
|
||||
github.com/gethinode/mod-katex v1.0.3/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.0.4 h1:NozgWPFnHhx1W+E9DnwMTRpvxPbdqdANEtwp9N3/mj8=
|
||||
github.com/gethinode/mod-katex v1.0.4/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.0.5 h1:AVhcTINYory0ygChQERf8PcyJkbT1oqhmLRF6ESnWOY=
|
||||
github.com/gethinode/mod-katex v1.0.5/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-leaflet v0.3.4 h1:oY+YQ0JiJuhFQNrk9XgFdg0NMsTUQPXNfnILp4ia4r4=
|
||||
github.com/gethinode/mod-leaflet v0.3.4/go.mod h1:uGggt87x4Fw7wBoJpSiUvNkYg+s/Ujne7klAX2rxMRk=
|
||||
github.com/gethinode/mod-leaflet v0.3.5 h1:69Bv/6zRXhbcTzo7TMr58h3ry47srHRpM1k81LrLbYU=
|
||||
|
@@ -38,8 +38,14 @@
|
||||
"sub",
|
||||
"sup",
|
||||
"svg",
|
||||
"table",
|
||||
"tbody",
|
||||
"td",
|
||||
"th",
|
||||
"thead",
|
||||
"time",
|
||||
"title",
|
||||
"tr",
|
||||
"ul",
|
||||
"use"
|
||||
],
|
||||
@@ -120,12 +126,15 @@
|
||||
"col-8",
|
||||
"col-9",
|
||||
"col-auto",
|
||||
"col-lg-2",
|
||||
"col-lg-4",
|
||||
"col-lg-8",
|
||||
"col-md-10",
|
||||
"col-md-2",
|
||||
"col-md-3",
|
||||
"col-md-4",
|
||||
"col-md-8",
|
||||
"col-md-9",
|
||||
"col-md-auto",
|
||||
"col-sm-12",
|
||||
"col-sm-3",
|
||||
@@ -141,6 +150,7 @@
|
||||
"d-grid",
|
||||
"d-inline",
|
||||
"d-inline-flex",
|
||||
"d-lg-block",
|
||||
"d-md-block",
|
||||
"d-md-flex",
|
||||
"d-md-none",
|
||||
@@ -332,6 +342,7 @@
|
||||
"row",
|
||||
"row-cols-1",
|
||||
"row-cols-2",
|
||||
"row-cols-lg-3",
|
||||
"row-cols-md-2",
|
||||
"row-cols-md-3",
|
||||
"row-cols-sm-2",
|
||||
@@ -341,6 +352,7 @@
|
||||
"search-suggestions",
|
||||
"shadow",
|
||||
"show",
|
||||
"sidebar-overflow",
|
||||
"slide",
|
||||
"small",
|
||||
"spinner-border",
|
||||
@@ -352,6 +364,8 @@
|
||||
"syntax-highlight",
|
||||
"tab-content",
|
||||
"tab-pane",
|
||||
"table",
|
||||
"table-responsive",
|
||||
"tag-link",
|
||||
"text-bg-body",
|
||||
"text-bg-body-tertiary",
|
||||
|
6
go.mod
6
go.mod
@@ -5,9 +5,9 @@ go 1.19
|
||||
require (
|
||||
github.com/airbnb/lottie-web v5.12.2+incompatible // indirect
|
||||
github.com/gethinode/mod-bootstrap v1.2.2 // indirect
|
||||
github.com/gethinode/mod-flexsearch v1.6.0 // indirect
|
||||
github.com/gethinode/mod-fontawesome v1.5.1 // indirect
|
||||
github.com/gethinode/mod-katex v1.0.4 // indirect
|
||||
github.com/gethinode/mod-flexsearch v1.7.1 // indirect
|
||||
github.com/gethinode/mod-fontawesome v1.7.3 // indirect
|
||||
github.com/gethinode/mod-katex v1.0.5 // indirect
|
||||
github.com/gethinode/mod-leaflet v0.3.5 // indirect
|
||||
github.com/gethinode/mod-lottie v1.3.0 // indirect
|
||||
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 // indirect
|
||||
|
10
go.sum
10
go.sum
@@ -36,6 +36,10 @@ github.com/gethinode/mod-flexsearch v1.5.1 h1:9fYlnHgiEXckL0EoC0zlSNO7BWZf5yiOro
|
||||
github.com/gethinode/mod-flexsearch v1.5.1/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-flexsearch v1.6.0 h1:Rjx+GLOByFLmaWD9hZXwmuKN8A89te6BZAIq2c9QBKg=
|
||||
github.com/gethinode/mod-flexsearch v1.6.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-flexsearch v1.7.0 h1:VFTf6iUyT9b47jTDAxh8nVHU1eUBrdxlykaC90lTfqk=
|
||||
github.com/gethinode/mod-flexsearch v1.7.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-flexsearch v1.7.1 h1:f4rjKkhleDVzqwUmwP1xZdhjru5VQ9g0MRDz0G6oLyY=
|
||||
github.com/gethinode/mod-flexsearch v1.7.1/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-fontawesome v1.0.2 h1:ZSK6D20/w4y5GnfYfTBB58uHD0ChIfkpKfRGwioS9rg=
|
||||
github.com/gethinode/mod-fontawesome v1.0.2/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-fontawesome v1.1.0 h1:rsDzUI+3ZlS/do2ff3ne8/z3KwHeysmuA+WsXlumXXk=
|
||||
@@ -64,6 +68,10 @@ github.com/gethinode/mod-fontawesome v1.5.0 h1:3mW5dnWauuF9wSWXNIY+PPgTNPlc/xQOQ
|
||||
github.com/gethinode/mod-fontawesome v1.5.0/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-fontawesome v1.5.1 h1:C7goQY4HrEua/lpjC++laydNKBuYo1+307ngn5tyXeM=
|
||||
github.com/gethinode/mod-fontawesome v1.5.1/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-fontawesome v1.6.1 h1:iqOgDGdw7Bs4hnzjF/8JsUn10omyKQZTglLqNenT1K0=
|
||||
github.com/gethinode/mod-fontawesome v1.6.1/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-fontawesome v1.7.3 h1:YzRCYSasVRIcImVmTJYjqNJ+KmyNWfm/bMgtM0slvzs=
|
||||
github.com/gethinode/mod-fontawesome v1.7.3/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
|
||||
github.com/gethinode/mod-katex v1.0.0 h1:me/3dIIZBkfk1mRIFt8QiAGYwYDoSG5bc2hHRtIutFc=
|
||||
github.com/gethinode/mod-katex v1.0.0/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.0.1 h1:809QUztxmKgMNchU+v03iMO7Ma+ISc3ZzhXYauc21rs=
|
||||
@@ -74,6 +82,8 @@ github.com/gethinode/mod-katex v1.0.3 h1:fvlUWqcUQqv2zRNM2kfmJ6GhXA816Tl1nfVrUkm
|
||||
github.com/gethinode/mod-katex v1.0.3/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.0.4 h1:NozgWPFnHhx1W+E9DnwMTRpvxPbdqdANEtwp9N3/mj8=
|
||||
github.com/gethinode/mod-katex v1.0.4/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.0.5 h1:AVhcTINYory0ygChQERf8PcyJkbT1oqhmLRF6ESnWOY=
|
||||
github.com/gethinode/mod-katex v1.0.5/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-leaflet v0.2.3 h1:QQI4h+IH0jZ7fx4q0um2YIEiYBoW3OAfW8qHzbRCDPk=
|
||||
github.com/gethinode/mod-leaflet v0.2.3/go.mod h1:uGggt87x4Fw7wBoJpSiUvNkYg+s/Ujne7klAX2rxMRk=
|
||||
github.com/gethinode/mod-leaflet v0.3.1 h1:H5MaOa+BB1KuVw7abTqfIn/SNzzRsAyx/WQoSe+2Ykc=
|
||||
|
@@ -45,8 +45,10 @@
|
||||
"col-12",
|
||||
"col-6",
|
||||
"col-md-2",
|
||||
"col-md-3",
|
||||
"col-md-4",
|
||||
"col-md-8",
|
||||
"col-md-9",
|
||||
"col-sm-12",
|
||||
"collapse",
|
||||
"collapsed",
|
||||
@@ -147,7 +149,6 @@
|
||||
"row-cols-1",
|
||||
"row-cols-2",
|
||||
"row-cols-md-2",
|
||||
"row-cols-sm-2",
|
||||
"row-cols-sm-3",
|
||||
"search",
|
||||
"search-input",
|
||||
|
@@ -30,9 +30,9 @@
|
||||
- id: shareSystem
|
||||
translation: "Betriebssystem"
|
||||
- id: copyToClipboard
|
||||
translation: "In Zwischenablage kopieren"
|
||||
translation: "In die Zwischenablage kopieren"
|
||||
- id: copiedToClipboard
|
||||
translation: "Der Text befindet sich in die Zwischenablage"
|
||||
translation: "befindet sich in der Zwischenablage"
|
||||
- id: link
|
||||
translation: "Link zur Webseite"
|
||||
- id: code
|
||||
|
14
i18n/en.yaml
14
i18n/en.yaml
@@ -133,3 +133,17 @@
|
||||
translation: "Show"
|
||||
- id: comments
|
||||
translation: "Comments"
|
||||
|
||||
# Arguments
|
||||
- id: name
|
||||
translation: "Name"
|
||||
- id: type
|
||||
translation: "Type"
|
||||
- id: required
|
||||
translation: "Required"
|
||||
- id: default
|
||||
translation: "Default"
|
||||
- id: comment
|
||||
translation: "Comment"
|
||||
- id: supportedValues
|
||||
translation: "Supported values"
|
||||
|
15
i18n/nl.yaml
15
i18n/nl.yaml
@@ -131,3 +131,18 @@
|
||||
translation: "Tonen"
|
||||
- id: comments
|
||||
translation: "Reacties"
|
||||
|
||||
|
||||
# Arguments
|
||||
- id: name
|
||||
translation: "Naam"
|
||||
- id: type
|
||||
translation: "Type"
|
||||
- id: required
|
||||
translation: "Verplicht"
|
||||
- id: default
|
||||
translation: "Standaardwaarde"
|
||||
- id: comment
|
||||
translation: "Toelichting"
|
||||
- id: supportedValues
|
||||
translation: "Toegestane waarden"
|
||||
|
135
i18n/zh-hans.yaml
Normal file
135
i18n/zh-hans.yaml
Normal file
@@ -0,0 +1,135 @@
|
||||
# Single pages
|
||||
- id: postedOnDate
|
||||
translation: "发布于 {{ . }}"
|
||||
- id: lastModified
|
||||
translation: "最后修改于 {{ . }}"
|
||||
- id: read
|
||||
translation: "阅读"
|
||||
- id: minutesShort
|
||||
translation: "分钟"
|
||||
- id: words
|
||||
translation: "字"
|
||||
- id: photoFull
|
||||
translation: "照片由 %s 于 %s 拍摄"
|
||||
- id: photoShort
|
||||
translation: "照片由 {{ . }} 拍摄"
|
||||
- id: photoOn
|
||||
translation: "于"
|
||||
- id: draft
|
||||
translation: "草稿"
|
||||
|
||||
# List pages
|
||||
- id: article
|
||||
translation: "文章"
|
||||
- id: articles
|
||||
translation: "文章"
|
||||
- id: more
|
||||
translation: "更多 {{ . }}"
|
||||
- id: emptyList
|
||||
translation: "没有找到文章"
|
||||
- id: emptyTags
|
||||
translation: "没有找到标签"
|
||||
|
||||
# Languages
|
||||
- id: lang_de
|
||||
translation: "German"
|
||||
- id: lang_en
|
||||
translation: "English"
|
||||
- id: lang_nl
|
||||
translation: "Dutch"
|
||||
- id: lang_fr
|
||||
translation: "French"
|
||||
|
||||
# Sharing
|
||||
- id: shareLink
|
||||
translation: "分享至 {{ . }}"
|
||||
- id: shareSystem
|
||||
translation: "系统"
|
||||
- id: copyToClipboard
|
||||
translation: "复制到剪贴板"
|
||||
- id: copiedToClipboard
|
||||
translation: "已复制到剪贴板"
|
||||
- id: link
|
||||
translation: "链接"
|
||||
- id: code
|
||||
translation: "代码"
|
||||
- id: download
|
||||
translation: "下载文章"
|
||||
|
||||
# Pagination
|
||||
- id: paginationNav
|
||||
translation: "页面导航"
|
||||
- id: paginationPrevious
|
||||
translation: "上一页"
|
||||
- id: paginationNext
|
||||
translation: "下一页"
|
||||
- id: paginationFirst
|
||||
translation: "第一页"
|
||||
- id: paginationLast
|
||||
translation: "最后一页"
|
||||
|
||||
# Navigation
|
||||
- id: colorMode
|
||||
translation: "切换主题"
|
||||
- id: colorLight
|
||||
translation: "亮色"
|
||||
- id: colorDark
|
||||
translation: "暗色"
|
||||
- id: colorAuto
|
||||
translation: "自动"
|
||||
- id: toggleMainNav
|
||||
translation: "切换主导航"
|
||||
- id: home
|
||||
translation: "首页"
|
||||
- id: languageSwitcherLabel
|
||||
translation: "语言"
|
||||
- id: close
|
||||
translation: "关闭"
|
||||
|
||||
# Table of contents
|
||||
- id: toc
|
||||
translation: "本页目录"
|
||||
- id: seeAlso
|
||||
translation: "参见"
|
||||
- id: sectionMenu
|
||||
translation: "选择一个主题"
|
||||
|
||||
# Sidebar
|
||||
- id: toggleSidebar
|
||||
translation: "切换侧边栏导航"
|
||||
|
||||
# Feature
|
||||
- id: addedFeature
|
||||
translation: "新增于 {{ . }}"
|
||||
- id: deprecatedFeature
|
||||
translation: "已弃用于 {{ . }}"
|
||||
|
||||
# Versioning
|
||||
- id: latest
|
||||
translation: "最新"
|
||||
- id: allVersions
|
||||
translation: "所有版本"
|
||||
- id: newerVersionAlert
|
||||
translation: "有一个更新版本的 {{ . }}!"
|
||||
|
||||
# 404 page
|
||||
- id: pageNotFound
|
||||
translation: "您访问的页面不存在或发生了其他错误。请返回我们的{{ . }}。"
|
||||
- id: pageNotFoundTitle
|
||||
translation: "页面未找到"
|
||||
- id: pageNotFoundHome
|
||||
translation: "首页"
|
||||
|
||||
# Footer
|
||||
- id: copyright
|
||||
translation: "Copyright"
|
||||
- id: rights
|
||||
translation: "版权所有"
|
||||
- id: poweredBy
|
||||
translation: "由 {{ . }} 提供支持。"
|
||||
|
||||
# Comments
|
||||
- id: show
|
||||
translation: "显示"
|
||||
- id: comments
|
||||
translation: "评论"
|
135
i18n/zh-hant.yaml
Normal file
135
i18n/zh-hant.yaml
Normal file
@@ -0,0 +1,135 @@
|
||||
# Single pages
|
||||
- id: postedOnDate
|
||||
translation: "發佈於 {{ . }}"
|
||||
- id: lastModified
|
||||
translation: "最後修改於 {{ . }}"
|
||||
- id: read
|
||||
translation: "閱讀"
|
||||
- id: minutesShort
|
||||
translation: "分鐘"
|
||||
- id: words
|
||||
translation: "字"
|
||||
- id: photoFull
|
||||
translation: "照片由 %s 於 %s 拍攝"
|
||||
- id: photoShort
|
||||
translation: "照片由 {{ . }} 拍攝"
|
||||
- id: photoOn
|
||||
translation: "於"
|
||||
- id: draft
|
||||
translation: "草稿"
|
||||
|
||||
# List pages
|
||||
- id: article
|
||||
translation: "文章"
|
||||
- id: articles
|
||||
translation: "文章"
|
||||
- id: more
|
||||
translation: "更多 {{ . }}"
|
||||
- id: emptyList
|
||||
translation: "沒有找到文章"
|
||||
- id: emptyTags
|
||||
translation: "沒有找到標籤"
|
||||
|
||||
# Languages
|
||||
- id: lang_de
|
||||
translation: "German"
|
||||
- id: lang_en
|
||||
translation: "English"
|
||||
- id: lang_nl
|
||||
translation: "Dutch"
|
||||
- id: lang_fr
|
||||
translation: "French"
|
||||
|
||||
# Sharing
|
||||
- id: shareLink
|
||||
translation: "分享至 {{ . }}"
|
||||
- id: shareSystem
|
||||
translation: "系統"
|
||||
- id: copyToClipboard
|
||||
translation: "複製到剪貼板"
|
||||
- id: copiedToClipboard
|
||||
translation: "已複製到剪貼板"
|
||||
- id: link
|
||||
translation: "連結"
|
||||
- id: code
|
||||
translation: "程式碼"
|
||||
- id: download
|
||||
translation: "下載文章"
|
||||
|
||||
# Pagination
|
||||
- id: paginationNav
|
||||
translation: "頁面導航"
|
||||
- id: paginationPrevious
|
||||
translation: "上一頁"
|
||||
- id: paginationNext
|
||||
translation: "下一頁"
|
||||
- id: paginationFirst
|
||||
translation: "第一頁"
|
||||
- id: paginationLast
|
||||
translation: "最後一頁"
|
||||
|
||||
# Navigation
|
||||
- id: colorMode
|
||||
translation: "切換主題"
|
||||
- id: colorLight
|
||||
translation: "亮色"
|
||||
- id: colorDark
|
||||
translation: "暗色"
|
||||
- id: colorAuto
|
||||
translation: "自動"
|
||||
- id: toggleMainNav
|
||||
translation: "切換主導航"
|
||||
- id: home
|
||||
translation: "首頁"
|
||||
- id: languageSwitcherLabel
|
||||
translation: "語言"
|
||||
- id: close
|
||||
translation: "關閉"
|
||||
|
||||
# Table of contents
|
||||
- id: toc
|
||||
translation: "本頁目錄"
|
||||
- id: seeAlso
|
||||
translation: "參見"
|
||||
- id: sectionMenu
|
||||
translation: "選擇一個主題"
|
||||
|
||||
# Sidebar
|
||||
- id: toggleSidebar
|
||||
translation: "切換側邊欄導航"
|
||||
|
||||
# Feature
|
||||
- id: addedFeature
|
||||
translation: "新增於 {{ . }}"
|
||||
- id: deprecatedFeature
|
||||
translation: "已棄用於 {{ . }}"
|
||||
|
||||
# Versioning
|
||||
- id: latest
|
||||
translation: "最新"
|
||||
- id: allVersions
|
||||
translation: "所有版本"
|
||||
- id: newerVersionAlert
|
||||
translation: "有一個更新版本的 {{ . }}!"
|
||||
|
||||
# 404 page
|
||||
- id: pageNotFound
|
||||
translation: "您訪問的頁面不存在或發生了其他錯誤。請返回我們的{{ . }}。"
|
||||
- id: pageNotFoundTitle
|
||||
translation: "頁面未找到"
|
||||
- id: pageNotFoundHome
|
||||
translation: "首頁"
|
||||
|
||||
# Footer
|
||||
- id: copyright
|
||||
translation: "Copyright"
|
||||
- id: rights
|
||||
translation: "版權所有"
|
||||
- id: poweredBy
|
||||
translation: "由 {{ . }} 提供支持。"
|
||||
|
||||
# Comments
|
||||
- id: show
|
||||
translation: "顯示"
|
||||
- id: comments
|
||||
translation: "評論"
|
@@ -1,5 +1,12 @@
|
||||
{{- define "partials/optional-scripts.html" -}}
|
||||
{{- $modules := site.Params.modules.optional | intersect .Params.modules -}}
|
||||
{{ $page_modules := slice }}
|
||||
{{ if reflect.IsMap .Params.modules }}
|
||||
{{ $page_modules = .Params.modules }}
|
||||
{{ else }}
|
||||
{{ $page_modules = $page_modules | append .Params.modules }}
|
||||
{{ end }}
|
||||
|
||||
{{- $modules := site.Params.modules.optional | intersect $page_modules -}}
|
||||
{{- range $index, $mod := $modules -}}
|
||||
{{- $filename := printf "js/%s.bundle.js" $mod -}}
|
||||
{{- $match := printf "js/modules/%s/**.js" $mod -}}
|
||||
@@ -48,6 +55,9 @@
|
||||
{{ $sections := partial "utilities/GetSections.html" (dict "page" . "loading" $loading) }}
|
||||
{{- $.Scratch.Set "sections" $sections -}}
|
||||
|
||||
{{- /* Define main breakpoint */ -}}
|
||||
{{- $.Scratch.Set "breakpoint" (partial "utilities/GetBreakpoint.html") }}
|
||||
|
||||
<!doctype html>
|
||||
<html lang="{{ .Site.Language.Lang }}" class="no-js">
|
||||
<head>
|
||||
|
@@ -1,9 +1,10 @@
|
||||
{{- $sections := $.Scratch.Get "sections" -}}
|
||||
{{- $fullCover := $.Scratch.Get "fullCover" -}}
|
||||
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
|
||||
{{- $layout := .Params.layout -}}
|
||||
|
||||
<div class="row row-cols-1 row-cols-sm-2">
|
||||
<div class="col col-sm-12 col-md-8">
|
||||
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2">
|
||||
<div class="col-12 col-{{ $breakpoint.current }}-9">
|
||||
{{ if not .IsHome }}
|
||||
{{ with .Title }}<p id="{{ anchorize . }}" class="display-4 mt-5{{ if and $.IsHome site.Params.home.centerHeadline }} text-center{{ end }}">{{ . }}</p>{{ end }}
|
||||
{{ end }}
|
||||
@@ -15,9 +16,12 @@
|
||||
{{- if $fullCover }}{{ $loading = site.Params.main.loading }}{{ end }}
|
||||
{{ end }}
|
||||
{{- $content := partial "utilities/ProcessContent" (dict "page" . "raw" .RawContent "loading" $loading) -}}
|
||||
{{ $content | safeHTML }}
|
||||
{{- $content | safeHTML -}}
|
||||
{{ if and (and $sections (eq (len $sections) 1)) (not $content) }}
|
||||
<p class="pt-4">{{- T "emptyList" }}.</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-{{ $breakpoint.current }}-3 d-none d-{{ $breakpoint.current }}-block">
|
||||
{{/* Empty in default layout */}}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,10 +1,11 @@
|
||||
{{- define "partials/single-main.html" -}}
|
||||
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
|
||||
{{ if .Site.Params.navigation.breadcrumb }}{{ partial "assets/breadcrumb.html" . }}{{ end -}}
|
||||
|
||||
{{ .Render "single/header" }}
|
||||
|
||||
{{- if and .Site.Params.navigation.toc .Params.includeToc | default true -}}
|
||||
<div class="d-md-none pb-5">{{ partial "assets/toc-dropdown.html" . }}</div>
|
||||
<div class="d-{{ $breakpoint.current }}-none pb-5">{{ partial "assets/toc-dropdown.html" . }}</div>
|
||||
{{- end -}}
|
||||
{{ .Render "single/body" }}
|
||||
|
||||
@@ -18,6 +19,7 @@
|
||||
{{ define "main" -}}
|
||||
{{- $menu := .Scratch.Get "sidebar" -}}
|
||||
{{- $version := .Scratch.Get "version" -}}
|
||||
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
|
||||
|
||||
{{ $sidebar := "" }}
|
||||
{{- $hasSidebar := .Site.Params.navigation.sidebar | default true -}}
|
||||
@@ -38,34 +40,24 @@
|
||||
{{ end }}
|
||||
|
||||
<div class="container-xxl flex-fill p-4 px-xxl-0">
|
||||
{{ if and $menu $hasSidebar -}}
|
||||
<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">
|
||||
{{ if $hasSidebar -}}
|
||||
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2 row-cols-{{ $breakpoint.next }}-3">
|
||||
<div class="col col-{{ $breakpoint.next }}-2 d-none d-{{ $breakpoint.next }}-block sidebar-overflow sticky-top pt-5">
|
||||
{{ $sidebar | safeHTML }}
|
||||
</div>
|
||||
<div class="col col-md-9 col-lg-8 mb-5 p-4">
|
||||
<div class="col-12 col-{{ $breakpoint.current }}-9 col-{{ $breakpoint.next }}-8 mb-5 p-4">
|
||||
{{ partial "partials/single-main.html" . }}
|
||||
</div>
|
||||
<div class="col col-lg-2 d-none d-lg-block pt-5">
|
||||
<div class="col col-{{ $breakpoint.current }}-3 col-{{ $breakpoint.next }}-2 d-none d-{{ $breakpoint.current }}-block pt-5">
|
||||
{{ $toc | safeHTML }}
|
||||
</div>
|
||||
</div>
|
||||
{{ else if $hasSidebar }}
|
||||
<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">
|
||||
{{ partial "partials/single-main.html" . }}
|
||||
</div>
|
||||
<div class="col col-md-2 d-none d-md-block">
|
||||
{{ $toc | safeHTML }}
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="row row-cols-1 row-cols-sm-2">
|
||||
<div class="col col-sm-12 col-md-9">
|
||||
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2">
|
||||
<div class="col col-{{ $breakpoint.prev }}-12 col-{{ $breakpoint.current }}-9">
|
||||
{{ partial "partials/single-main.html" . }}
|
||||
</div>
|
||||
<div class="col col-md-3 d-none d-md-block">
|
||||
<div class="col col-{{ $breakpoint.current }}-3 d-none d-{{ $breakpoint.current }}-block">
|
||||
{{ $toc | safeHTML }}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -67,7 +67,7 @@
|
||||
{{- with .badge }}{{ $badge = . }}{{ end -}}
|
||||
|
||||
{{- $label := "" -}}
|
||||
{{- with .label }}{{ $label = . }}{{ end -}}
|
||||
{{- if .label }}{{ $label = .label }}{{ else }}{{ $label = $title }}{{ end -}}
|
||||
|
||||
{{- $tooltip := "" -}}
|
||||
{{- if not (strings.HasSuffix $state "active") -}}
|
||||
@@ -143,7 +143,8 @@
|
||||
|
||||
{{- $attributes := .attributes -}}
|
||||
|
||||
<a aria-label="{{ (or $label $title) | safeHTML }}" {{ if ne $state "disabled" }}{{ with $href }}href="{{ . }}"{{ end }}{{ end -}}
|
||||
<a aria-label="{{ (or $label $title) | safeHTML }}"
|
||||
{{ if ne $state "disabled" }}{{ with $href }}href="{{ . }}"{{ end }}{{ end -}}
|
||||
{{- with $id }} id="{{ . }}"{{ end -}}
|
||||
{{- with $target }} target="{{ . }}"{{ end }}{{ with $rel }} rel="{{ . }}"{{ end -}}
|
||||
{{- with $toast }} data-toast-target="{{ $toast }}"{{ end -}}
|
||||
|
@@ -36,6 +36,7 @@
|
||||
-->
|
||||
|
||||
{{- $page := .page -}}
|
||||
{{- $breakpoint := partial "utilities/GetBreakpoint.html" -}}
|
||||
|
||||
{{- if not (in (slice "*hugolib.pageState" "*hugolib.pageForShortcode") (printf "%T" $page)) -}}
|
||||
{{- errorf "partial [assets/card-group.html] - Invalid value for param 'page': %T" $page -}}
|
||||
@@ -66,7 +67,7 @@
|
||||
{{ range $index, $element := $pages }}
|
||||
{{ $params := dict }}
|
||||
<!-- regular page -->
|
||||
{{- if $element.RelPermalink -}}
|
||||
{{- if and $element.RelPermalink $element.File -}}
|
||||
{{- $params = merge $params (dict "path" $element.File.Path) -}}
|
||||
<!-- headless page -->
|
||||
{{- else -}}
|
||||
@@ -108,10 +109,10 @@
|
||||
{{- end -}}
|
||||
{{- $colGrid := "" -}}
|
||||
{{- if eq $cols "1" }}{{ $colGrid = "row-cols-1" -}}
|
||||
{{- else if eq $cols "2" }}{{ if $responsive }}{{ $colGrid = "row-cols-1 row-cols-sm-1 row-cols-md-2" }}{{ else }}{{ $colGrid = "row-cols-2" }}{{ end -}}
|
||||
{{- else if eq $cols "3" }}{{ if $responsive }}{{ $colGrid = "row-cols-1 row-cols-sm-2 row-cols-md-3" }}{{ else }}{{ $colGrid = "row-cols-3" }}{{ end -}}
|
||||
{{- else if eq $cols "4" }}{{ if $responsive }}{{ $colGrid = "row-cols-1 row-cols-sm-2 row-cols-md-4" }}{{ else }}{{ $colGrid = "row-cols-4" }}{{ end -}}
|
||||
{{- else if eq $cols "5" }}{{ if $responsive }}{{ $colGrid = "row-cols-1 row-cols-sm-3 row-cols-md-5" }}{{ else }}{{ $colGrid = "row-cols-5" }}{{ end -}}
|
||||
{{- else if eq $cols "2" }}{{ if $responsive }}{{ $colGrid = printf "row-cols-1 row-cols-%s-1 row-cols-%s-2" $breakpoint.prev $breakpoint.current }}{{ else }}{{ $colGrid = "row-cols-2" }}{{ end -}}
|
||||
{{- else if eq $cols "3" }}{{ if $responsive }}{{ $colGrid = printf "row-cols-1 row-cols-%s-2 row-cols-%s-3" $breakpoint.prev $breakpoint.current }}{{ else }}{{ $colGrid = "row-cols-3" }}{{ end -}}
|
||||
{{- else if eq $cols "4" }}{{ if $responsive }}{{ $colGrid = printf "row-cols-1 row-cols-%s-2 row-cols-%s-4" $breakpoint.prev $breakpoint.current }}{{ else }}{{ $colGrid = "row-cols-4" }}{{ end -}}
|
||||
{{- else if eq $cols "5" }}{{ if $responsive }}{{ $colGrid = printf "row-cols-1 row-cols-%s-3 row-cols-%s-5" $breakpoint.prev $breakpoint.current }}{{ else }}{{ $colGrid = "row-cols-5" }}{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $gutter := .gutter | default "4" -}}
|
||||
|
@@ -1,31 +1,49 @@
|
||||
<!--
|
||||
Displays a Bootstrap card. Either specify a valid path, or set the arguments title, href, header, description, and
|
||||
thumbnail individually. The latter arguments override any page attributes.
|
||||
|
||||
The shortcode supports the following arguments:
|
||||
"path" Optional path of the page, override with other parameters.
|
||||
"title" Required title of the card.
|
||||
"href" Optional address for the button or hyperlink.
|
||||
"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", "body", or "body-tertiary". By default, no
|
||||
color is specified.
|
||||
"padding": Optional padding of the content, either "0", "1", "2", "3", "4", "5", or "auto" (default).
|
||||
"gutter" Gutter between columns in a group, either "0" (default), "1", "2", "3", "4", or "5".
|
||||
"header" Optional header components of the card, displayed in small caps. Supported values are "full"
|
||||
(default), "publication", "tags", and "none".
|
||||
"footer" Optional footer components of the card, displayed in small caps. Supported values are "full",
|
||||
"publication", "tags", and "none" (default).
|
||||
"description" Optional description of the card.
|
||||
"thumbnail" Optional thumbnail image url, displayed on top or the left of the card.
|
||||
"ratio" Optional ratio of the thumbnail image, defaults to "16x9" (stacked orientation) or "1x1" (horizontal
|
||||
orientation).
|
||||
"alt" Optional alternate text for the thumbnail, uses "title" by default.
|
||||
"icon" Optional Font Awesome icon, displayed on top or the left of the card.
|
||||
"orientation" Optional placecement of the thumbnail or icon, either "stacked" (default), "horizontal",
|
||||
"horizontal-sm" or "none".
|
||||
Copyright © 2023 The Hinode Team / Mark Dumay. All rights reserved.
|
||||
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
||||
Visit gethinode.com/license for more details.
|
||||
-->
|
||||
|
||||
<!-- Validate and initialize arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "card" "args" .) }}
|
||||
{{- errorf "partial [assets/card.html] - Invalid arguments" -}}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments and default values -->
|
||||
{{- $alt := .alt -}}
|
||||
{{- $class := .class -}}
|
||||
{{- $color := .color -}}
|
||||
{{- $description := .description -}}
|
||||
{{- $footer := .footer | default "none" -}}
|
||||
{{- $gutter := .gutter | default "0" -}}
|
||||
{{- $header := .header | default "full" -}}
|
||||
{{- $href := .href -}}
|
||||
{{- $icon := .icon -}}
|
||||
{{- $loading := .loading -}}
|
||||
{{- $orientation := .orientation | default "stacked" -}}
|
||||
{{- $padding := .padding | default "auto" -}}
|
||||
{{- $ratio := .ratio -}}
|
||||
{{- $thumbnail := .thumbnail -}}
|
||||
{{- $title := .title -}}
|
||||
|
||||
<!-- Override arguments -->
|
||||
{{- $page := "" }}
|
||||
{{- if .path }}
|
||||
{{- $page = site.GetPage .path }}
|
||||
{{- if not $page }}
|
||||
{{- errorf "partial [assets/card.html] - Cannot find page: %s" .path -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $page -}}
|
||||
{{- if not $title }}{{ $title = .Title }}{{ end -}}
|
||||
{{- if not $href }}{{ $href = .RelPermalink }}{{ end -}}
|
||||
{{- if not $description }}{{ $description = partial "utilities/GetDescription.html" . }}{{ end -}}
|
||||
{{- if not $thumbnail }}{{ $thumbnail = (or (and (reflect.IsMap .Params.Thumbnail) .Params.Thumbnail.url) .Params.Thumbnail) }}{{ end -}}
|
||||
{{- if not $icon }}{{ $icon = .Params.icon }}{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if eq $orientation "none" }}{{ $thumbnail = "" }}{{ $icon = "" }}{{ end -}}
|
||||
|
||||
<!-- Inline partial to render the card's body -->
|
||||
{{- define "partials/card-body.html" -}}
|
||||
{{- $title := .title -}}
|
||||
@@ -77,85 +95,11 @@
|
||||
</small></p>
|
||||
{{- end -}}
|
||||
|
||||
{{- $page := "" }}
|
||||
{{- if .path }}
|
||||
{{- $page = site.GetPage .path }}
|
||||
{{- if not $page }}
|
||||
{{- errorf "partial [assets/card.html] - Cannot find page: %s" .path -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $title := .title -}}
|
||||
{{- $alt := .alt -}}
|
||||
{{- $href := .href -}}
|
||||
{{- $description := .description -}}
|
||||
{{- $thumbnail := .thumbnail -}}
|
||||
{{- $ratio := .ratio -}}
|
||||
{{- $icon := .icon -}}
|
||||
|
||||
{{- $color := "" -}}
|
||||
{{- with .color }}{{ $color = . }}{{ end -}}
|
||||
{{- if $color -}}
|
||||
{{- $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" "white" "black" "body" "body-tertiary" -}}
|
||||
{{- if not (in $supportedColors $color) -}}
|
||||
{{- errorf "partial [assets/card.html] - Invalid value for param 'color': %s" $color -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $header := "full" -}}
|
||||
{{- with .header }}{{ $header = . }}{{ end -}}
|
||||
{{- $supportedKeywords := slice "full" "publication" "tags" "none" -}}
|
||||
{{- if not (in $supportedKeywords $header) -}}
|
||||
{{- errorf "partial [assets/card.html] - Invalid value for param 'header': %s" $header -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $footer := "none" -}}
|
||||
{{- with .footer }}{{ $footer = . }}{{ end -}}
|
||||
{{- if not (in $supportedKeywords $footer) -}}
|
||||
{{- errorf "partial [assets/card.html] - Invalid value for param 'footer': %s" $footer -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $page -}}
|
||||
{{- if not $title }}{{ $title = .Title }}{{ end -}}
|
||||
{{- if not $href }}{{ $href = .RelPermalink }}{{ end -}}
|
||||
{{- if not $description }}{{ $description = partial "utilities/GetDescription.html" . }}{{ end -}}
|
||||
{{- if not $thumbnail }}{{ $thumbnail = (or (and (reflect.IsMap .Params.Thumbnail) .Params.Thumbnail.url) .Params.Thumbnail) }}{{ end -}}
|
||||
{{- if not $icon }}{{ $icon = .Params.icon }}{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $class := .class -}}
|
||||
|
||||
{{- $padding := "auto" -}}
|
||||
{{- with .padding }}{{ $padding = . }}{{ end -}}
|
||||
{{- $supportedPaddings := slice "0" "1" "2" "3" "4" "5" "auto" -}}
|
||||
{{- if not (in $supportedPaddings $padding) -}}
|
||||
{{- errorf "partial [assets/card.html] - Invalid value for param 'padding': %s" $padding -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $gutter := .gutter | default "0" -}}
|
||||
{{ $supportedGutters:= slice "0" "1" "2" "3" "4" "5" -}}
|
||||
{{ if not (in $supportedGutters $gutter) -}}
|
||||
{{- errorf "partial [assets/card.html] - Invalid value for param 'gutter': %s" $gutter -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $orientation := "stacked" -}}
|
||||
{{- with .orientation }}{{ $orientation = . }}{{ end -}}
|
||||
{{- $supportedOrientations := slice "stacked" "horizontal" "horizontal-sm" "none" -}}
|
||||
{{- if not (in $supportedOrientations $orientation) -}}
|
||||
{{- errorf "partial [assets/card.html] - Invalid value for param 'orientation': %s" $orientation -}}
|
||||
{{- end -}}
|
||||
{{- if eq $orientation "none" }}{{ $thumbnail = "" }}{{ $icon = "" }}{{ end -}}
|
||||
|
||||
{{- $loading := .loading -}}
|
||||
{{- $validSettings := slice "lazy" "eager" -}}
|
||||
{{- if $loading -}}
|
||||
{{ if not (in $validSettings $loading) -}}
|
||||
{{- errorf "partial [assets/card.html] - Invalid value for param 'loading': %s" $loading -}}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Main code -->
|
||||
{{ if ne $gutter "0" }}<div class="g-{{ $gutter }}">{{ end }}
|
||||
|
||||
{{- if hasPrefix $orientation "horizontal" -}}
|
||||
<!-- Render horizontal card -->
|
||||
<div class="card {{ with $color }}bg-{{ . }} text-bg-{{ . }}{{ end }} {{ $class }}">
|
||||
<div class="row g-0 row-cols-1 h-100">
|
||||
<div class="col-4{{ if eq $orientation "horizontal-sm" }} col-md-2{{ end }}">
|
||||
@@ -179,6 +123,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{- else -}}
|
||||
<!-- Render stacked / default card -->
|
||||
<div class="card {{ with $color }}bg-{{ . }} text-bg-{{ . }}{{ end }} {{ $class }}">
|
||||
{{- if $thumbnail -}}
|
||||
{{- partial "assets/image.html" (dict "url" $thumbnail "ratio" (or $ratio "16x9") "outerClass" "card-img-wrap" "innerClass" "card-img-top" "title" (or $alt $title) "loading" $loading) -}}
|
||||
@@ -194,4 +139,5 @@
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{ if ne $gutter "0" }}</div>{{ end }}
|
||||
|
@@ -44,7 +44,7 @@
|
||||
{{- with index . "sectionHeader" }}{{ $sectionHeader = . }}{{ end -}}
|
||||
{{- with index . "sort" }}{{ $sort = . }}{{ end -}}
|
||||
{{- if (index . "reverse") }}{{ $order = "desc" }}{{ else }}{{ $order = "asc" }}{{ end -}}
|
||||
{{- if $home }}{{- if (isset . "nested") }}{{ $nested = (index . "nested") }}{{ end -}}{{ end -}}
|
||||
{{- if (isset . "nested") }}{{ $nested = (index . "nested") }}{{ end -}}
|
||||
{{- if (index . "separator") }}{{ $separator = true }}{{ else }}{{ $separator = false }}{{ end -}}
|
||||
{{- with index . "orientation" }}{{ $orientation = . }}{{ end -}}
|
||||
{{- with index . "cols" }}{{ $cols = . }}{{ end -}}
|
||||
@@ -64,6 +64,10 @@
|
||||
{{- with index . "ratio" }}{{ $ratio = . }}{{ end -}}
|
||||
{{- with index . "wrap" }}{{ $wrap = . }}{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ if isset $page.Params "nested" }}
|
||||
{{ $nested = $page.Params.nested }}
|
||||
{{ end }}
|
||||
{{ if ne (printf "%T" $nested) "bool" }}
|
||||
{{ errorf "partial [assets/section-list.html] - Invalid value for param 'nested'"}}
|
||||
{{ end }}
|
||||
@@ -84,15 +88,19 @@
|
||||
{{ $opts := dict "namedSlices" (slice $keywords) }}
|
||||
{{ $list = site.RegularPages.Related $opts }}
|
||||
{{ end }}
|
||||
{{ else if $page.IsSection }}
|
||||
{{ $list = $page.Pages }}
|
||||
{{ else if $nested }}
|
||||
{{ $list = where site.RegularPages "Type" "in" $section }}
|
||||
{{ else if $home }}
|
||||
{{ $sectionPage := site.GetPage "section" $section }}
|
||||
{{ $list = $sectionPage.RegularPages }}
|
||||
{{ if $nested }}
|
||||
{{ $list = $sectionPage.RegularPagesRecursive }}
|
||||
{{ else }}
|
||||
{{ $list = $sectionPage.Pages }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $list = $page.RegularPages }}
|
||||
{{ if $nested }}
|
||||
{{ $list = $page.RegularPagesRecursive }}
|
||||
{{ else }}
|
||||
{{ $list = $page.Pages }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $max := (len $list) -}}
|
||||
|
25
layouts/partials/assets/table.html
Normal file
25
layouts/partials/assets/table.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{ $page := .page }}
|
||||
{{ $input := .input }}
|
||||
{{ $args := .args }}
|
||||
|
||||
{{- $responsiveVals := slice "table-responsive" "table-responsive-none" "table-responsive-sm" "table-responsive-md" "table-responsive-lg" "table-responsive-xl" "table-responsive-xxl" -}}
|
||||
{{- $responsive := intersect $args $responsiveVals -}}
|
||||
{{- $main := complement $responsive $args -}}
|
||||
|
||||
{{- if in $responsive "table-responsive-none" -}}
|
||||
{{- $responsive = "" -}}
|
||||
{{- else if not $responsive -}}
|
||||
{{ $responsive = (slice "table-responsive") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $input := $input | $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 -}}
|
||||
{{- with $responsive }}<div class="{{ delimit . " " }}">{{ end -}}
|
||||
{{ $input | safeHTML }}
|
||||
{{- with $responsive }}</div>{{ end -}}
|
14
layouts/partials/utilities/CastBool.html
Normal file
14
layouts/partials/utilities/CastBool.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{ $input := . }}
|
||||
{{ $output := "" }}
|
||||
|
||||
{{ if eq (printf "%T" $input) "bool" }}
|
||||
{{ $output = $input }}
|
||||
{{ else if eq $input "true" }}
|
||||
{{ $output = true }}
|
||||
{{ else if eq $input "false" }}
|
||||
{{ $output = false }}
|
||||
{{ else }}
|
||||
{{ errorf "Cannot cast '%s' to bool" $input }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $output }}
|
21
layouts/partials/utilities/GetBreakpoint.html
Normal file
21
layouts/partials/utilities/GetBreakpoint.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{- /* Define main breakpoint */ -}}
|
||||
{{ $prev := 0 }}
|
||||
{{ $next := 0 }}
|
||||
{{ $result := dict }}
|
||||
{{- $breakpoints := slice "xs" "sm" "md" "lg" "xl" "xxl" }}
|
||||
{{- $breakpoint := site.Params.main.breakpoint | default "md" -}}
|
||||
{{- if not (in $breakpoints $breakpoint) -}}
|
||||
{{- errorf "layout [_default/baseof.html] - Invalid value for param 'breakpoint': %s" $breakpoint -}}
|
||||
{{ else }}
|
||||
{{ range $index, $item := $breakpoints }}
|
||||
{{ if eq $item $breakpoint }}
|
||||
{{ $prev = sub $index 1 }}
|
||||
{{ $next = add $index 1 }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if lt $prev 0 }}{{ $prev = 0 }}{{ end }}
|
||||
{{ if ge $next (len $breakpoints) }}{{ $next = sub (len $breakpoints) 1 }}{{ end }}
|
||||
{{ $result = dict "prev" (index $breakpoints $prev) "current" $breakpoint "next" (index $breakpoints $next) }}
|
||||
{{- end -}}
|
||||
|
||||
{{ return $result }}
|
@@ -1,13 +1,28 @@
|
||||
<!--
|
||||
Retrieve a local or remote resource. If the url starts with 'http', the resource is retrieved from an external
|
||||
location. Else, the url is matched with a page resource and site asset (in that order). The partial returns nil if
|
||||
the resource cannot be found. The partial supports the following arguments:
|
||||
location. Else, the url is matched with a page resource and site asset (in that order).
|
||||
|
||||
This partial supports both relative and absolute paths. Hugo has different methods to retrieve page bundle assets
|
||||
and site assets. Absolute paths are converted to a relative path to make them compatible with Hugo's methods. The
|
||||
prefix of an absolute path is truncated if it matches either with the page bundle folder (starting with "/content/")
|
||||
or the assets folder ("/assets/").
|
||||
|
||||
The partial returns nil if the resource cannot be found. The partial supports the following arguments:
|
||||
"url" Required path or url of the resource, e.g. "img/example.jpg" or "https://example.com/img.jpg"
|
||||
"page" Optional page context, used to retrieve a resource from page resources.
|
||||
-->
|
||||
|
||||
{{ $url := .url -}}
|
||||
{{ $page := .page -}}
|
||||
{{ if hasPrefix $url "/" }}
|
||||
{{ $pageContext := (path.Join "/content" $page.File.Dir) -}}
|
||||
{{ if hasPrefix $url $pageContext }}
|
||||
{{ $url = strings.TrimPrefix $pageContext $url -}}
|
||||
{{ else if hasPrefix $url "/assets/" }}
|
||||
{{ $url = strings.TrimPrefix "/assets/" $url -}}
|
||||
{{ end }}
|
||||
{{ $url = strings.TrimPrefix "/" $url -}}
|
||||
{{ end }}
|
||||
|
||||
{{ $res := "" }}
|
||||
{{ $remote := hasPrefix (lower $url) "http" }}
|
||||
|
@@ -48,7 +48,8 @@
|
||||
|
||||
{{- $thumbnail := (or (and (reflect.IsMap $sectionPage.Params.Thumbnail) $sectionPage.Params.Thumbnail.url) $sectionPage.Params.Thumbnail) -}}
|
||||
{{- $icon := $sectionPage.Params.Icon -}}
|
||||
{{- $content := $sectionPage.Content -}}
|
||||
{{- $content := "" -}}
|
||||
{{ if not $sectionPage.IsSection }}{{ $content = $sectionPage.Content }}{{ end -}}
|
||||
{{- $sectionTitle := strings.FirstUpper $sectionPage.Type -}}
|
||||
{{- $moreTitle := "" -}}
|
||||
{{- with (index site.Params.sections $section) -}}
|
||||
@@ -61,7 +62,6 @@
|
||||
"section" $section
|
||||
"home" $page.IsHome
|
||||
"simple" (eq (len $sections) 1)
|
||||
"nested" (and $page.IsHome (eq $section $page.Section))
|
||||
"thumbnail" $thumbnail
|
||||
"icon" $icon
|
||||
"content" $content
|
||||
|
119
layouts/partials/utilities/IsInvalidArgs.html
Normal file
119
layouts/partials/utilities/IsInvalidArgs.html
Normal file
@@ -0,0 +1,119 @@
|
||||
<!--
|
||||
Copyright © 2023 The Hinode Team / Mark Dumay. All rights reserved.
|
||||
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
||||
Visit gethinode.com/license for more details.
|
||||
-->
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
{{ $aliases := dict "path" "string" "select" "string" "url" "string" }}
|
||||
|
||||
{{ $structure := .structure }}
|
||||
{{ if not $structure }}
|
||||
{{- errorf "partial [utilities/ValidateArgs.html] - Missing value for param 'structure'" -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ $args := .args | default dict }}
|
||||
|
||||
{{ $definitions := (index site.Data.structures $structure).arguments }}
|
||||
{{ if not $definitions }}
|
||||
{{- errorf "partial [utilities/ValidateArgs.html] - Missing definitions: %s" $structure -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ $namedArgs := true }}
|
||||
|
||||
{{ if not $error }}
|
||||
{{ range $key, $val := $args }}
|
||||
{{ $def := "" }}
|
||||
{{ if eq (printf "%T" $key) "string" }}
|
||||
{{ $def = index $definitions $key }}
|
||||
{{ else }}
|
||||
{{ $namedArgs = false }}
|
||||
{{ range $d := $definitions }}
|
||||
{{ if eq $d.position $key }}{{ $def = $d }}{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if not $def }}
|
||||
{{ if eq (printf "%T" $key) "string" }}
|
||||
{{ warnf "[%s] unsupported argument '%s'" $structure $key }}
|
||||
{{ else if eq (printf "%T" $key) "int" }}
|
||||
{{ warnf "[%s] unsupported argument at index %d (value: '%s')" $structure $key $val }}
|
||||
{{ else }}
|
||||
{{ warnf "[%s] unsupported argument value '%s'" $structure $val }}
|
||||
{{ end }}
|
||||
{{ $error = true }}
|
||||
{{ else }}
|
||||
{{ if and (not $val) $def.default }}{{ $val = $def.default }}{{ end }}
|
||||
|
||||
{{/* validate type */}}
|
||||
{{ $expected := slice | append $def.type }}
|
||||
{{ $extra := slice }}
|
||||
{{ range $expected }}
|
||||
{{ $alias := index $aliases . }}
|
||||
{{ if $alias }}{{ $extra = $extra | append $alias }}{{ end }}
|
||||
{{ end }}
|
||||
{{ if $extra }}{{ $expected = $expected | append $extra }}{{ end }}
|
||||
{{ $actual := printf "%T" $val }}
|
||||
|
||||
{{/* cast supported types from string */}}
|
||||
{{ if and (in $expected "bool") (in (slice "true" "false") $val) }}
|
||||
{{ $actual = "bool" }}
|
||||
{{ else if and (in $expected "int") (findRE `^-?\d+$` $val) }}
|
||||
{{ $actual = "int" }}
|
||||
{{ else if and (in $expected "float") (findRE `^(?:[1-9]\d*|0)?(?:\.\d+)?$` $val) }}
|
||||
{{ $actual = "float" }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $val }}
|
||||
{{ if not (in $expected $actual ) }}
|
||||
{{ warnf "[%s] argument '%s': expected type '%s', got '%s'" $structure $key (delimit $expected ", ") $actual }}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* validate permitted values */}}
|
||||
{{ if and $def.options.values (eq $actual "select") }}
|
||||
{{ if and (not $def.optional) (not (in $def.options.values $val)) }}
|
||||
{{ warnf "[%s] argument '%s': unexpected value '%s'" $structure $key $val }}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ else if and $def.options.min (in (slice "int" "float" "float64") $actual) }}
|
||||
{{ if lt $val $def.options.min }}
|
||||
{{ warnf "[%s] argument '%s': value '%s' out of range [$d, $d]" $structure $key $val $def.options.min $def.options.max}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ else if and $def.options.max (in (slice "int" "float" "float64") $actual) }}
|
||||
{{ if (gt $val $def.options.max) }}
|
||||
{{ warnf "[%s] argument '%s': value '%s' out of range [$d, $d]" $structure $key $val $def.options.min $def.options.max}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* validate required arguments */}}
|
||||
{{ $max := len $args }}
|
||||
{{ $expected := 0 }}
|
||||
{{ range $key, $val := $definitions }}
|
||||
{{ if not $val.optional }}
|
||||
{{ if $namedArgs }}
|
||||
{{ if not (isset $args $key) }}
|
||||
{{ warnf "[%s] argument '%s': expected value" $structure $key }}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $expected = add $expected 1 }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if lt $max $expected }}
|
||||
{{ warnf "[%s] expected '%d' args, got '%d'" $structure $expected $max }}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $error }}
|
@@ -1,46 +1,37 @@
|
||||
<!--
|
||||
Creates an HTML element that shows the long form of an abbrevitation. The abbreviation data is centrally stored in a
|
||||
data file. By default, the shortcode uses "abbr.yaml" with translation support.
|
||||
|
||||
The data file is expected to store key-value pairs, where "id" is the lower-case abbrevation and "long" its long
|
||||
form. The following example illustrates this using YML:
|
||||
|
||||
- id: css
|
||||
long: "Cascading Style Sheets"
|
||||
|
||||
The shortcode supports the following arguments:
|
||||
"key" Required case-insensitive key of the abbreviation. In shorthand notation, this is the first (and
|
||||
only) matched argument.
|
||||
"data" Optional filename of the abbrevation input. It defaults to "abbr.yaml" with translation support.
|
||||
You can omit the file extension. The file should reside in the "data" folder. The data supports
|
||||
language extensions. For example, "abbr.en.yaml" refers to the English translation of the
|
||||
abbrevation data. The filename "abbr.yaml" is used when no suitable translation is found.
|
||||
"class" Optional class attribute of the abbr element. For example, specify "initialism" for a slightly
|
||||
smaller font size.
|
||||
Copyright © 2023 The Hinode Team / Mark Dumay. All rights reserved.
|
||||
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
||||
Visit gethinode.com/license for more details.
|
||||
-->
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
<!-- Validate and initialize arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "abbr" "args" .Params) }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments and default values -->
|
||||
{{ $key := "" }}
|
||||
{{- if .IsNamedParams }}{{ $key = .Get "key" }}{{ else }}{{ $key = .Get 0 }}{{ end }}
|
||||
{{ $data := "abbr" }}
|
||||
{{ $class := "" }}
|
||||
{{ $title := "" }}
|
||||
{{ $entries := slice }}
|
||||
|
||||
{{ if not $key -}}
|
||||
{{ errorf "Missing param 'key': %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end -}}
|
||||
|
||||
{{- $data := .Get "data" | default "abbr" -}}
|
||||
{{ if not $data -}}
|
||||
{{ errorf "Missing param 'data': %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end -}}
|
||||
|
||||
{{- $class := .Get "class" | default "" -}}
|
||||
{{- if .IsNamedParams }}
|
||||
{{ $key = .Get "key" }}
|
||||
{{- $data := .Get "data" | default "abbr" -}}
|
||||
{{- $class := .Get "class" | default "" -}}
|
||||
{{ else }}
|
||||
{{ $key = .Get 0 }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Main code -->
|
||||
{{ if not $error }}
|
||||
{{/* Try language-specific file first */}}
|
||||
{{ $path := path.Join (path.Dir $data) (printf "%s.%s" (path.BaseName $data) .Page.Language.Lang) (path.Ext $data) }}
|
||||
{{ $entries := index site.Data $path }}
|
||||
{{ $entries = index site.Data $path }}
|
||||
{{/* Use exact provided path as backup */}}
|
||||
{{ if not $entries -}}
|
||||
{{ $entries = index site.Data $data }}
|
||||
@@ -49,20 +40,19 @@
|
||||
{{ errorf "Invalid abbrevation data '%s': %s" $data .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
|
||||
{{ $title := "" }}
|
||||
{{ if not $error }}
|
||||
{{ $elements := (where $entries "id" (lower $key)) }}
|
||||
{{ if gt (len $elements) 0 }}
|
||||
{{ $title = index (index $elements 0) "long" }}
|
||||
{{ end -}}
|
||||
{{ if not $title -}}
|
||||
{{ errorf "Cannot find value for '%s': %s" $key .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
{{ if not $error }}
|
||||
{{ $elements := (where $entries "id" (lower $key)) }}
|
||||
{{ if gt (len $elements) 0 }}
|
||||
{{ $title = index (index $elements 0) "long" }}
|
||||
{{ end -}}
|
||||
{{ if not $title -}}
|
||||
{{ errorf "Cannot find value for '%s': %s" $key .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if not $error }}
|
||||
<abbr {{ with $class }}class="{{ . }}"{{ end }} title="{{ $title }}" tabindex="0">{{ $key }}</abbr>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if not $error }}
|
||||
<abbr {{ with $class }}class="{{ . }}"{{ end }} title="{{ $title }}" tabindex="0">{{ $key }}</abbr>
|
||||
{{ end }}
|
||||
|
@@ -1,27 +1,41 @@
|
||||
<!--
|
||||
Defines an individual accordion item. The shortcode supports the following arguments:
|
||||
"header" Required header of the accordion element.
|
||||
"class" Optional class attribute of the inner accordion element.
|
||||
"show" Optional flag to indicate an item should be shown as collapsed.
|
||||
Copyright © 2023 The Hinode Team / Mark Dumay. All rights reserved.
|
||||
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
||||
Visit gethinode.com/license for more details.
|
||||
-->
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "accordion-item" "args" .Params) }}
|
||||
{{ if .Parent }}
|
||||
{{ errorf "Invalid arguments: %s" .Parent.Position -}}
|
||||
{{ else }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ end }}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ if not .Parent }}
|
||||
{{ errorf "Cannot use isolated accordion-item, wrap it in an accordion: %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments and default values -->
|
||||
|
||||
{{- $id := .Ordinal -}}
|
||||
{{- $parent := printf "accordion-%d" .Parent.Ordinal -}}
|
||||
{{- with (.Parent.Get "id") -}}
|
||||
{{- $parent = . -}}
|
||||
{{ $parent := "" }}
|
||||
{{ if not $error }}
|
||||
{{- $parent = printf "accordion-%d" .Parent.Ordinal -}}
|
||||
{{- with (.Parent.Get "id") -}}
|
||||
{{- $parent = . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $id := .Ordinal -}}
|
||||
{{ $header := .Get "header" | default "" -}}
|
||||
{{ if not $header -}}
|
||||
{{ if .Parent }}
|
||||
{{ errorf "Missing value for param 'header': %s" .Parent.Position -}}
|
||||
{{ else }}
|
||||
{{ errorf "Missing value for param 'header': %s" .Position -}}
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
|
||||
{{ $header := .Get "header" -}}
|
||||
{{ $class := .Get "class" | default "" -}}
|
||||
|
||||
{{ $body := trim .Inner " \r\n" -}}
|
||||
{{ if not $body -}}
|
||||
{{ if .Parent }}
|
||||
@@ -29,27 +43,24 @@
|
||||
{{ else }}
|
||||
{{ errorf "Missing inner element text: %s" .Position -}}
|
||||
{{ end }}
|
||||
{{ $error = true }}
|
||||
{{ end -}}
|
||||
|
||||
{{ $supportedFlags := slice "true" "false" -}}
|
||||
{{ $showParam := "false" -}}
|
||||
<!-- Main code -->
|
||||
{{ $show := false -}}
|
||||
{{ with .Get "show" }}{{ $showParam = . }}{{ end -}}
|
||||
{{ if in $supportedFlags $showParam -}}
|
||||
{{ if eq $showParam "true" }}{{ $show = true }}{{ else }}{{ $show = false }}{{ end -}}
|
||||
{{ else -}}
|
||||
{{ errorf "Invalid value for param 'show': %s" $showParam -}}
|
||||
{{ end -}}
|
||||
{{ if not $error }}
|
||||
{{ with .Get "show" }}{{ $show = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||
|
||||
<div class="accordion-item">
|
||||
{{- with $header -}}
|
||||
<h2 class="accordion-header m-0" id="{{ $parent }}-heading-{{ $id }}">
|
||||
<button class="accordion-button{{ if not $show }} collapsed{{ end }}" type="button" data-bs-toggle="collapse" data-bs-target="#{{ $parent }}-item-{{ $id }}" aria-expanded="false" aria-controls="{{ $parent }}-item-{{ $id }}">
|
||||
{{ . }}
|
||||
</button>
|
||||
</h2>
|
||||
{{- end -}}
|
||||
<div id="{{ $parent }}-item-{{ $id }}" class="accordion-collapse collapse{{ if $show }} show{{ end }}{{ with $class }} {{ . }}{{ end }}" aria-labelledby="{{ $parent }}-heading-{{ $id }}" data-bs-parent="#{{ $parent }}">
|
||||
<div class="accordion-body">{{ $body | .Page.RenderString | safeHTML }}</div>
|
||||
<div class="accordion-item">
|
||||
{{- with $header -}}
|
||||
<h2 class="accordion-header m-0" id="{{ $parent }}-heading-{{ $id }}">
|
||||
<button class="accordion-button{{ if not $show }} collapsed{{ end }}" type="button" data-bs-toggle="collapse" data-bs-target="#{{ $parent }}-item-{{ $id }}" aria-expanded="false" aria-controls="{{ $parent }}-item-{{ $id }}">
|
||||
{{ . }}
|
||||
</button>
|
||||
</h2>
|
||||
{{- end -}}
|
||||
<div id="{{ $parent }}-item-{{ $id }}" class="accordion-collapse collapse{{ if $show }} show{{ end }}{{ with $class }} {{ . }}{{ end }}" aria-labelledby="{{ $parent }}-heading-{{ $id }}" data-bs-parent="#{{ $parent }}">
|
||||
<div class="accordion-body">{{ $body | .Page.RenderString | safeHTML }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
@@ -1,34 +1,31 @@
|
||||
<!--
|
||||
Displays a group of vertically collapsing and expanding items. Add accordion-item inner elements for each accordion
|
||||
item. The shortcode supports the following arguments:
|
||||
"id": Optional id of the accordion, defaults to "accordion-" with a sequential number.
|
||||
"always-open": Optional flag to make accordion items stay open when another item is opened.
|
||||
"class": Optional class attribute of the accordion element, e.g. “w-50”.
|
||||
Copyright © 2023 The Hinode Team / Mark Dumay. All rights reserved.
|
||||
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
||||
Visit gethinode.com/license for more details.
|
||||
-->
|
||||
|
||||
{{- $id := printf "accordion-%d" .Ordinal -}}
|
||||
{{ with .Get "id" }}
|
||||
{{ $id = . }}
|
||||
{{ $error := false }}
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "accordion" "args" .Params) }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{- $class := .Get "class" | default "" -}}
|
||||
|
||||
{{- $openParam := "false" -}}
|
||||
{{- $open := false -}}
|
||||
{{- with .Get "always-open" }}{{ $openParam = . }}{{ end -}}
|
||||
{{- $supportedFlags := slice "true" "false" -}}
|
||||
{{- if in $supportedFlags $openParam -}}
|
||||
{{- if eq $openParam "true" }}{{ $open = true }}{{ end -}}
|
||||
{{- else -}}
|
||||
{{- errorf "Invalid value for param 'always-open': %s" .Position -}}
|
||||
{{- $error = true -}}
|
||||
{{- end -}}
|
||||
<!-- Main code -->
|
||||
{{ if not $error }}
|
||||
{{- $id := printf "accordion-%d" .Ordinal -}}
|
||||
{{ with .Get "id" }}{{ $id = . }}{{ end }}
|
||||
{{- $class := .Get "class" | default "" -}}
|
||||
{{- $open := false -}}
|
||||
{{ with .Get "always-open" }}{{ $open = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||
{{- $body := .Inner -}}
|
||||
{{- if $open -}}
|
||||
{{- $pattern := printf "data-bs-parent=\"#%s\"" $id -}}
|
||||
{{- $body = (replace .Inner $pattern "") | .Page.RenderString | safeHTML }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $body := .Inner -}}
|
||||
{{- if $open -}}
|
||||
{{- $pattern := printf "data-bs-parent=\"#%s\"" $id -}}
|
||||
{{- $body = (replace .Inner $pattern "") | .Page.RenderString | safeHTML }}
|
||||
{{- end -}}
|
||||
|
||||
<div id="{{ $id }}" class="accordion mb-3{{ with $class }} {{ . }}{{ end }}">
|
||||
{{- $body -}}
|
||||
</div>
|
||||
<div id="{{ $id }}" class="accordion mb-3{{ with $class }} {{ . }}{{ end }}">
|
||||
{{- $body -}}
|
||||
</div>
|
||||
{{ end }}
|
@@ -1,61 +1,41 @@
|
||||
<!--
|
||||
Displays an alert. The shortcode supports the following arguments:
|
||||
"color": Optional theme color of the alert, either "primary" (default), "secondary", "success", "danger",
|
||||
"warning", "info", "light", "dark", "white" or "black".
|
||||
"dismissible" Optional flag to indicate the alert is dismissible, defaults to false.
|
||||
"icon" Optional class and name of a Font Awesome icon to include.
|
||||
"type" Optional type of the alert, either "danger" or "info". Generates an alert with related color and
|
||||
icon.
|
||||
"class": Optional class attribute of the alert element.
|
||||
Copyright © 2023 The Hinode Team / Mark Dumay. All rights reserved.
|
||||
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
||||
Visit gethinode.com/license for more details.
|
||||
-->
|
||||
|
||||
{{- $error := false -}}
|
||||
{{ $color := "primary" -}}
|
||||
{{ $icon := "" }}
|
||||
{{ $type := "" -}}
|
||||
{{ $error := false }}
|
||||
|
||||
{{ with .Get "type" }}{{ $type = . }}{{ end -}}
|
||||
{{ $supportedTypes := slice "danger" "info" -}}
|
||||
{{ if $type }}
|
||||
{{ if not (in $supportedTypes $type) -}}
|
||||
{{ errorf "Invalid value for param 'type': %s" .Position -}}
|
||||
{{ $error = true -}}
|
||||
{{ else }}
|
||||
{{ $color = $type }}
|
||||
{{ if eq $type "danger" }}{{ $icon = "fas triangle-exclamation" }}{{ else }}{{ $icon = "fa lightbulb" }}{{ end }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "alert" "args" .Params) }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Get "color" }}{{ $color = . }}{{ end -}}
|
||||
{{ $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" -}}
|
||||
{{ if not (in $supportedColors $color) -}}
|
||||
{{ errorf "Invalid value for param 'color': %s" .Position -}}
|
||||
{{ $error = true -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ with .Get "icon" }}{{ $icon = . }}{{ end }}
|
||||
<!-- Initialize arguments -->
|
||||
{{ $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 }}
|
||||
{{ with $icon }}
|
||||
{{ $icon = partial "assets/icon.html" (dict "icon" (printf "%s fa-2x fa-fw" .)) }}
|
||||
{{ end }}
|
||||
|
||||
{{ $dismissibleParam := "false" -}}
|
||||
{{ $dismissible := false -}}
|
||||
{{ with .Get "dismissible" }}{{ $dismissibleParam = . }}{{ end -}}
|
||||
{{ $supportedFlags := slice "true" "false" -}}
|
||||
{{ if in $supportedFlags $dismissibleParam -}}
|
||||
{{ if eq $dismissibleParam "true" }}{{ $dismissible = true }}{{ end -}}
|
||||
{{ else -}}
|
||||
{{ errorf "Invalid value for param 'dismissible': %s" .Position -}}
|
||||
{{ $error = true -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ with .Get "dismissible" }}{{ $dismissible = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||
{{- $class := .Get "class" | default "" -}}
|
||||
|
||||
{{ $body := trim .Inner " \r\n" -}}
|
||||
{{ if not $body -}}
|
||||
{{ errorf "Missing inner element text: %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end -}}
|
||||
|
||||
<!-- Main code -->
|
||||
{{- if not $error -}}
|
||||
<div class="d-flex alert alert-{{ $color }} {{ if $dismissible }}alert-dismissible fade show{{ end }}{{ with $class }} {{ . }}{{ end }}" role="alert">
|
||||
{{ with $icon }}<div class="pt-1 pe-2">{{ . }}</div>{{ end }}
|
||||
<div class="flex-grow-1 my-auto">
|
||||
{{ trim .Inner " \r\n" | .Page.RenderString | safeHTML -}}
|
||||
{{ $body | .Page.RenderString | safeHTML -}}
|
||||
{{ if $dismissible }}<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="{{ T "close" }}"></button>{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
80
layouts/shortcodes/args.html
Normal file
80
layouts/shortcodes/args.html
Normal file
@@ -0,0 +1,80 @@
|
||||
<!--
|
||||
Copyright © 2023 The Hinode Team / Mark Dumay. All rights reserved.
|
||||
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
||||
Visit gethinode.com/license for more details.
|
||||
-->
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "args" "args" .Params) }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments -->
|
||||
{{ $structure := "" }}
|
||||
{{- if .IsNamedParams }}{{ $structure = .Get "structure" }}{{ else }}{{ $structure = .Get 0 }}{{ end }}
|
||||
{{ $group := "" }}
|
||||
{{- if .IsNamedParams }}{{ $group = .Get "group" | default "" }}{{ else }}{{ $group = .Get 1 | default "" }}{{ end }}
|
||||
{{ $definitions := "" }}
|
||||
|
||||
{{ if not $error }}
|
||||
{{ $definitions = (index site.Data.structures $structure).arguments }}
|
||||
{{ if not $definitions }}
|
||||
{{- errorf "Cannot find data structure '%s': %s" $structure .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Main code -->
|
||||
{{ if not $error }}
|
||||
{{ $table := printf "| %s | %s | %s | %s | %s |\n| --- | --- | --- | --- | --- |"
|
||||
(T "name") (T "type") (T "required") (T "default") (T "comment")
|
||||
}}
|
||||
|
||||
{{ range $key, $val := $definitions }}
|
||||
{{ $skip := false }}
|
||||
{{ $groups := slice | append $val.group }}
|
||||
{{ if and $group $val.group }}
|
||||
{{ $skip = not (in $groups $group )}}
|
||||
{{ end }}
|
||||
|
||||
{{ if not $skip }}
|
||||
{{ $type := $val.type }}
|
||||
{{ if reflect.IsSlice $val.type }}{{ $type = delimit $val.type ", " }}{{ end }}
|
||||
|
||||
{{ $required := "" }}
|
||||
{{ if not $val.optional }}{{ $required = "yes" }}{{ end }}
|
||||
|
||||
{{ $comment := $val.comment }}
|
||||
{{ if $val.deprecated }}
|
||||
{{ $comment = printf `{{< release version="%s" short="true" size="sm" inline="true" state="deprecated" >}} %s` $val.deprecated $comment }}
|
||||
{{ end }}
|
||||
{{ if $val.release }}
|
||||
{{ $comment = printf `{{< release version="%s" short="true" size="sm" inline="true" >}} %s` $val.release $comment }}
|
||||
{{ end }}
|
||||
|
||||
{{ $min := "" }}
|
||||
{{ $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 }}
|
||||
{{ end }}
|
||||
{{ if and $min $max }}
|
||||
{{ $comment = printf "%s %s: [%d, %d]." $comment (T "supportedValues") $min $max }}
|
||||
{{ else if $min }}
|
||||
{{ $comment = printf "%s %s: >=%d." $comment (T "supportedValues") $min }}
|
||||
{{ else if $max }}
|
||||
{{ $comment = printf "%s %s: <=%d." $comment (T "supportedValues") $max }}
|
||||
{{ end }}
|
||||
|
||||
{{ $table = printf "%s\n| %s | %s | %s | %s | %s |" $table $key $type $required (or $val.default "") $comment }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "assets/table.html" (dict "page" .Page "input" $table "args" slice) }}
|
||||
{{ end }}
|
@@ -1,28 +1,34 @@
|
||||
<!--
|
||||
Displays a Bootstrap card that links to a page. Any inner text is used as description. The shortcode supports the
|
||||
following arguments:
|
||||
"path" Optional path of the page. If omitted, specify the title, icon, thumbnail, and body as needed.
|
||||
"title" Optional title of the card.
|
||||
"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", "body", or "body-tertiary". By default, no
|
||||
color is specified.
|
||||
"padding" Optional padding of the content, either "0", "1", "2", "3", "4", "5", or "auto" (default).
|
||||
"gutter" Gutter between columns in a group, either "0" (default), "1", "2", "3", "4", or "5".
|
||||
"header" Optional header components of the card, displayed in small caps. Supported values are "full"
|
||||
(default), "publication", "tags", and "none".
|
||||
"footer" Optional footer components of the card, displayed in small caps. Supported values are "full",
|
||||
"publication", "tags", and "none" (default).
|
||||
"orientation" Optional placecement of the thumbnail, either "stacked" (default), "horizontal", or "none".
|
||||
"thumbnail" Optional thumbnail image url, displayed on top or the left of the card.
|
||||
"alt" Optional alternate text for the thumbnail, uses "title" by default.
|
||||
"icon" Optional Font Awesome icon, displayed on top or the left of the card.
|
||||
Copyright © 2023 The Hinode Team / Mark Dumay. All rights reserved.
|
||||
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
||||
Visit gethinode.com/license for more details.
|
||||
-->
|
||||
|
||||
{{ $error := false }}
|
||||
|
||||
{{ $path := or (.Get "path") "" }}
|
||||
{{ $page := .Page }}
|
||||
<!-- Validate arguments -->
|
||||
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "card" "args" .Params) }}
|
||||
{{ errorf "Invalid arguments: %s" .Position -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments and default values -->
|
||||
{{- $alt := .Get "alt" -}}
|
||||
{{- $class := partial "utilities/GetArgParent" (dict "page" . "arg" "class" "merge" true) -}}
|
||||
{{- $color := partial "utilities/GetArgParent" (dict "page" . "arg" "color") -}}
|
||||
{{- $description := trim .Inner " \r\n" | .Page.RenderString | safeHTML -}}
|
||||
{{- $footer := partial "utilities/GetArgParent" (dict "page" . "arg" "footer") | default "none" -}}
|
||||
{{- $gutter := partial "utilities/GetArgParent" (dict "page" . "arg" "gutter") | default "0" -}}
|
||||
{{- $header := partial "utilities/GetArgParent" (dict "page" . "arg" "header") | default "full" -}}
|
||||
{{- $icon := .Get "icon" -}}
|
||||
{{- $orientation := partial "utilities/GetArgParent" (dict "page" . "arg" "orientation") | default "stacked" -}}
|
||||
{{- $padding := partial "utilities/GetArgParent" (dict "page" . "arg" "padding") | default "auto" -}}
|
||||
{{- $page := .Page -}}
|
||||
{{- $path := .Get "path" -}}
|
||||
{{- $thumbnail := .Get "thumbnail" -}}
|
||||
{{- $title := .Get "title" -}}
|
||||
|
||||
<!-- Override arguments -->
|
||||
{{ if $path }}
|
||||
{{ $page = $.Site.GetPage $path }}
|
||||
{{ if not $page }}
|
||||
@@ -31,67 +37,13 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{- $class := partial "utilities/GetArg" (dict "page" . "arg" "class" "merge" true) -}}
|
||||
|
||||
{{- $color := partial "utilities/GetArg" (dict "page" . "arg" "color") -}}
|
||||
{{ if $color }}
|
||||
{{ $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 -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $header := partial "utilities/GetArg" (dict "page" . "arg" "header") | default "full" -}}
|
||||
{{ $supportedKeywords := slice "full" "publication" "tags" "none" -}}
|
||||
{{ if not (in $supportedKeywords $header) -}}
|
||||
{{ errorf "Invalid value for param 'header': %s" .Position -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $footer := partial "utilities/GetArg" (dict "page" . "arg" "footer") | default "none" -}}
|
||||
{{ if not (in $supportedKeywords $footer) -}}
|
||||
{{ errorf "Invalid value for param 'footer': %s" .Position -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $padding := partial "utilities/GetArg" (dict "page" . "arg" "padding") | default "auto" -}}
|
||||
{{ $supportedPaddings := slice "0" "1" "2" "3" "4" "5" "auto" -}}
|
||||
{{ if not (in $supportedPaddings $padding) -}}
|
||||
{{ errorf "Invalid value for param 'padding': %s" .Position -}}
|
||||
{{ $error = true -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $gutter := partial "utilities/GetArg" (dict "page" . "arg" "gutter") | default "0" -}}
|
||||
{{ $supportedGutters:= slice "0" "1" "2" "3" "4" "5" -}}
|
||||
{{ if not (in $supportedGutters $gutter) -}}
|
||||
{{ errorf "Invalid value for param 'gutter': %s" .Position -}}
|
||||
{{ $error = true -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $orientation := partial "utilities/GetArg" (dict "page" . "arg" "orientation") | default "stacked" -}}
|
||||
{{ $supportedOrientations := slice "stacked" "horizontal" "none" -}}
|
||||
{{ if not (in $supportedOrientations $orientation) -}}
|
||||
{{ errorf "Invalid value for param 'orientation': %s" .Position -}}
|
||||
{{ $error = true -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $layout := partial "utilities/GetArg" (dict "page" . "arg" "layout") | default "rich" -}}
|
||||
{{ $supportedLayouts := slice "rich" "minimal" -}}
|
||||
{{ if not (in $supportedLayouts $layout) -}}
|
||||
{{ errorf "Invalid value for param 'layout': %s" .Position -}}
|
||||
{{ $error = true -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $description := trim .Inner " \r\n" | .Page.RenderString | safeHTML }}
|
||||
{{ $title := .Get "title" | default "" -}}
|
||||
{{ $alt := .Get "alt" | default "" -}}
|
||||
{{ $icon := .Get "icon" | default "" -}}
|
||||
{{ $thumbnail := .Get "thumbnail" | default "" -}}
|
||||
|
||||
{{ if .Parent }}
|
||||
{{ $class = (printf "h-100 %s" $class) }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Main code -->
|
||||
{{ if not $error -}}
|
||||
<!-- Render card -->
|
||||
{{- $output := partial "assets/card.html" (dict
|
||||
"path" $path
|
||||
"title" $title
|
||||
@@ -108,6 +60,7 @@
|
||||
"alt" $alt
|
||||
) -}}
|
||||
|
||||
<!-- Pass output to parent or current stream -->
|
||||
{{ with .Parent }}
|
||||
{{ $current := .Scratch.Get "inner" }}
|
||||
{{ if $current }}
|
||||
|
@@ -15,8 +15,8 @@
|
||||
{{- $src := .Get "src" | default "" -}}
|
||||
{{- if $src -}}
|
||||
{{- $caption := .Get "caption" | default "" -}}
|
||||
{{- $ratio := partial "utilities/GetArg" (dict "page" . "arg" "ratio") -}}
|
||||
{{- $portrait := partial "utilities/GetArg" (dict "page" . "arg" "portrait") | default false -}}
|
||||
{{- $ratio := partial "utilities/GetArgParent" (dict "page" . "arg" "ratio") -}}
|
||||
{{- $portrait := partial "utilities/GetArgParent" (dict "page" . "arg" "portrait") | default false -}}
|
||||
{{- $active := eq .Ordinal 0 -}}
|
||||
{{- $output := partial "assets/carousel-item" (dict
|
||||
"page" .Page
|
||||
|
@@ -1,11 +1,13 @@
|
||||
{{ define "main" }}
|
||||
{{- $page := . -}}
|
||||
{{- $layout := $page.Params.layout -}}
|
||||
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
|
||||
{{- $hasSidebar := site.Params.navigation.sidebar | default true -}}
|
||||
|
||||
<div class="container-xxl flex-fill p-4 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">
|
||||
<div class="row row-cols-1 row-cols-{{ $breakpoint.prev }}-{{ if $hasSidebar }}3{{ else }}2{{ end }}">
|
||||
{{ if $hasSidebar }}<div class="col col-{{ $breakpoint.current }}-2 d-none d-{{ $breakpoint.current }}-block"></div>{{ end }}
|
||||
<div class="col col-{{ $breakpoint.prev }}-12 col-{{ $breakpoint.current }}-8">
|
||||
{{- if ne $layout "featured" -}}
|
||||
{{ if and (not $page.IsHome) site.Params.navigation.breadcrumb }}
|
||||
<div>{{ partial "assets/breadcrumb.html" $page }}</div>
|
||||
@@ -36,7 +38,7 @@
|
||||
{{ $year := .Date.Year }}
|
||||
{{ $lastYear := $.Scratch.Get "lastYear"}}
|
||||
<div class="row mt-2">
|
||||
<div class="d-none d-sm-block col-sm-3 mt-auto text-right">
|
||||
<div class="d-none d-{{ $breakpoint.prev }}-block col-{{ $breakpoint.prev }}-3 mt-auto text-right">
|
||||
<time class="post-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
|
||||
{{ (partial "utilities/date.html" (dict "date" .Date "format" "medium")) }}
|
||||
</time>
|
||||
@@ -52,7 +54,7 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="col col-md-2 d-none d-md-block"></div>
|
||||
<div class="col col-{{ $breakpoint.current }}-2 d-none d-{{ $breakpoint.current }}-block"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
@@ -5,11 +5,11 @@
|
||||
|
||||
[build.environment]
|
||||
DART_SASS_VERSION = "1.69.5"
|
||||
HUGO_VERSION = "0.120.3"
|
||||
HUGO_VERSION = "0.121.0"
|
||||
HUGO_ENV = "production"
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
NODE_VERSION = "18.18.2"
|
||||
NPM_VERSION = "9.8.1"
|
||||
NODE_VERSION = "18.19.0"
|
||||
NPM_VERSION = "10.2.3"
|
||||
# toml-docs-end netlify
|
||||
|
||||
[[headers]]
|
||||
|
641
package-lock.json
generated
641
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.21.6",
|
||||
"version": "0.22.0-alpha3",
|
||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||
"keywords": [
|
||||
"hugo",
|
||||
@@ -71,18 +71,18 @@
|
||||
"@gethinode/netlify-plugin-dartsass": "^0.2.0",
|
||||
"@netlify/plugin-lighthouse": "^5.0.0",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"cssnano": "^6.0.1",
|
||||
"cssnano-preset-advanced": "^6.0.1",
|
||||
"eslint": "^8.53.0",
|
||||
"cssnano": "^6.0.2",
|
||||
"cssnano-preset-advanced": "^6.0.2",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-n": "^16.3.1",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-n": "^16.5.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"hugo-bin": "^0.116.4",
|
||||
"markdownlint-cli2": "^0.10.0",
|
||||
"hugo-bin": "^0.117.1",
|
||||
"markdownlint-cli2": "^0.11.0",
|
||||
"netlify-plugin-hugo-cache-resources": "^0.2.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss-cli": "^10.1.0",
|
||||
"postcss-cli": "^11.0.0",
|
||||
"purgecss-whitelister": "^2.4.0",
|
||||
"replace-in-files-cli": "^2.2.0",
|
||||
"rimraf": "^5.0.5",
|
||||
|
Reference in New Issue
Block a user