diff --git a/layouts/_shortcodes/badge.html b/layouts/_shortcodes/badge.html index 370083a..8ff2836 100644 --- a/layouts/_shortcodes/badge.html +++ b/layouts/_shortcodes/badge.html @@ -1,3 +1,19 @@ +{{- /* +A shortcode to create a badge. + +@param {string} content The content of the badge. +@param {string} type The type of the badge. +@param {string} class The class of the badge. +@param {string} link The link of the badge. +@param {string} icon The icon of the badge. + +or + +@param {string} 0 The content of the badge. + +@example {{< badge content="info" type="info" >}} +*/ -}} + {{- if .IsNamedParams -}} {{- $content := .Get "content" -}} {{- $type := .Get "type" | default "" -}} diff --git a/layouts/_shortcodes/callout.html b/layouts/_shortcodes/callout.html index 8b5b8d5..5ccac93 100644 --- a/layouts/_shortcodes/callout.html +++ b/layouts/_shortcodes/callout.html @@ -1,3 +1,14 @@ +{{- /* +A shortcode to create a callout. + +@param {string} type The type of the callout (default, info, warning, error). +@param {string} content The content of the callout. +@param {string} emoji The emoji of the callout (related to type or can be a custom emoji). +@param {string} icon The icon of the callout. + +@example {{< callout type="info" >}}Content{{< /callout >}} +*/ -}} + {{- $calloutEmojiDict := dict "info" "ℹ️" "warning" "⚠️" "error" "🚫" -}} {{- $type := .Get "type" | default "default" -}} {{/* If emoji is not set, use the emoji from dict */}} diff --git a/layouts/_shortcodes/card.html b/layouts/_shortcodes/card.html index 1301bba..b623fc3 100644 --- a/layouts/_shortcodes/card.html +++ b/layouts/_shortcodes/card.html @@ -1,3 +1,20 @@ +{{- /* +A shortcode to create a card. + +@param {string} link The link to the card. +@param {string} title The title of the card. +@param {string} icon The icon of the card. +@param {string} subtitle The subtitle of the card. +@param {string} tag The tag of the card. +@param {string} tagType The type of the tag. +@param {string} image The image of the card. +@param {string} method The method to process the image. +@param {string} options The options to process the image. +@param {string} imageStyle The style of the image. + +@example {{< card link="/" title="Image Card" }} +*/ -}} + {{- $context := . -}} {{- $link := .Get "link" -}} {{- $title := .Get "title" -}} diff --git a/layouts/_shortcodes/cards.html b/layouts/_shortcodes/cards.html index 9230128..0b6667f 100644 --- a/layouts/_shortcodes/cards.html +++ b/layouts/_shortcodes/cards.html @@ -1,3 +1,11 @@ +{{- /* +A shortcode for creating cards. + +@param {string} cols The number of columns. + +@example {{< cards cols="3" >}}{{< /cards >}} +*/ -}} + {{- $cols := .Get "cols" | default 3 -}} {{- partial "shortcodes/cards" (dict "cols" $cols "content" .Inner) -}} diff --git a/layouts/_shortcodes/details.html b/layouts/_shortcodes/details.html index f27e1e9..66775ad 100644 --- a/layouts/_shortcodes/details.html +++ b/layouts/_shortcodes/details.html @@ -1,3 +1,12 @@ +{{- /* +A built-in component to display a collapsible content. + +@param {string} title The title of the details. +@param {string} closed Whether the details are closed or not (default: false). + +@example {{% details title="Details" %}}Content{{% /details %}} +*/ -}} + {{- $title := .Get "title" | default "" -}} {{- $closed := eq (.Get "closed") "true" | default false -}} diff --git a/layouts/_shortcodes/filetree/container.html b/layouts/_shortcodes/filetree/container.html index a679ad4..4efa192 100644 --- a/layouts/_shortcodes/filetree/container.html +++ b/layouts/_shortcodes/filetree/container.html @@ -1,3 +1,9 @@ +{{- /* +A file tree container. + +@example {{< filetree/container >}}{{< /filetree/container >}} +*/ -}} +
}} +@example {{< icon "github" >}} +*/ -}} + {{- $name := .Get "name" | default (.Get 0) -}} {{- $icon := index site.Data.icons $name -}} {{- $attributes := .Get "attributes" | default "height=1em"}} diff --git a/layouts/_shortcodes/jupyter.html b/layouts/_shortcodes/jupyter.html index e2ff643..ee8e16c 100644 --- a/layouts/_shortcodes/jupyter.html +++ b/layouts/_shortcodes/jupyter.html @@ -1,4 +1,11 @@ -{{/* Render Jupyter Notebook */}} +{{- /* +Render Jupyter Notebook + +@param {string} 0 The path of the Jupyter Notebook. + +@example {{% jupyter "notebook.ipynb" %}} +*/ -}} + {{- $path := .Get 0 -}} {{- $data := "" -}} {{- $page := .Page -}} diff --git a/layouts/_shortcodes/pdf.html b/layouts/_shortcodes/pdf.html index 9e3c4a9..40d4cf5 100644 --- a/layouts/_shortcodes/pdf.html +++ b/layouts/_shortcodes/pdf.html @@ -1,4 +1,10 @@ -{{/* Shortcode to include a PDF file in a page. */}} +{{- /* +Shortcode to include a PDF file in a page. + +@param {string} 0 The path to the PDF file. + +@example {{< pdf "path/to/file.pdf" >}} +*/ -}} {{- $path := .Get 0 -}} {{- $url := partial "utils/file-path" (dict "page" .Page "path" $path) -}} diff --git a/layouts/_shortcodes/steps.html b/layouts/_shortcodes/steps.html index bfe792e..1bccad1 100644 --- a/layouts/_shortcodes/steps.html +++ b/layouts/_shortcodes/steps.html @@ -1,3 +1,9 @@ +{{- /* +A shortcode for creating a step list. + +@example {{% steps %}}{{% /steps %}} +*/ -}} +