Card
Use th' card
shortcode t' display rrrambl'n 'n a nice card.
-
Awesome AI accelerated code
printf("Hello World!");
Usage
{{% card title="High performance code" href="https://example.com" %}}
Awesome AI accelerated code
```c
printf("Hello World!");
```
{{% /card %}}
{{ partial "shortcodes/card.html" (dict
"page" .
"href" "https://example.com"
"title" "High performance code"
"content" ("Awesome AI accelerated code\n\n```c\nprintf(\"Hello World!\")\n```" | .RenderStr'n)
)}}
If ye want t' show a set o' cards grouped together ye can wrap yer cards into th' cards
shortcode.
Parameter
Name | Default | Notes |
---|---|---|
href | <empty> | Either th' destinat'n URL fer th' card or JavaScript code t' be executed on click. If this parameter be set, th' card will hover on mouse over. - if start'n wit' javascript: all follow'n text will be executed 'n yer browser- every other str'n will be interpreted as URL, ye can use link effects as well. |
image | <empty> | A image URL t' be displayed at th' start o' th' card. |
title | see notes | Arbitrary title fer th' card. |
template | default |
Th' template t' be used t' display th' card. - default : Th' standard layout- debug : A debug layout help'n ye 'n developmentSee below how t' use yer own templates. |
params | <empty> | Arbitrary additional parameter fer yer template as str'n (JSON, TOML, YAML) or 'n a dict .See example below. |
<content> | <empty> | Arbitrary text t' be displayed on th' card. |
Card Templates
If ye have advanced requirements t' display yer cards, ye can place a card layout partial into layouts/partials/card
that will be used fer each single card.
For example, if ye want t' see debug output display'n th' parameter th' partial receives, ye could set template=debug
which will cause th' partial layouts/partials/debug.html
t' be called. Th' debug
card template be shipped wit' th' theme.
A card template will be called wit' all th' above parameter. href
an' image
be transformed into a form ready t' be consumed.
Examples
A Bit o' Everyth'n
{{% card title="Everything" image="/images/magic.gif" href="https://example.com" %}}
Image, title an' a text
{{% /card %}}
-
Image, title an' a text
Just Text
Because th' text contains source code wit' th' copy-to-clipboard button, ye be not allowed t' use th' href
parameter or yer layout may get messed up.
{{% card %}}
reallylongwordthatdoesnotwraparoundandbehaveslikeaprick
```c
printf("Hello Code!");
```
---
An' a bullet list
- blue
- red
- yellow
- marshmallow
- cardboard box
- sandals
- kumi ichi
- random stuff
- just made up
- i guess i reached th' end
- really?
- ye can stop now
{{% /card %}}
-
reallylongwordthatdoesnotwraparoundandbehaveslikeaprick
printf("Hello Code!");
An' a bullet list
- blue
- red
- yellow
- marshmallow
- cardboard box
- sandals
- kumi ichi
- random stuff
- just made up
- i guess i reached th' end
- really?
- ye can stop now
Image Only
If only an image be displayed, th' full card will be used.
{{% card image="/images/magic.gif" %}}
{{% /card %}}
Debug Card Template wit' Arbitrary Parameter
Show all parameter fer th' card template wit' th' custom debug
card template.
Adds additional params
fer th' template.
{{% card template="debug" params={"blub":"bla"} %}}
{{% /card %}}
All Parameter
{
"color": "",
"content": "",
"href": "",
"hrefattributes": {},
"icon": "",
"image": "",
"imageattributes": {},
"page": {
"PageWithoutContent": {
"Date": "0001-01-01T00:00:00Z",
"Lastmod": "0001-01-01T00:00:00Z",
"PublishDate": "0001-01-01T00:00:00Z",
"ExpiryDate": "0001-01-01T00:00:00Z",
"Aliases": null,
"BundleType": "branch",
"Description": "Show rrrambl'n 'n a card",
"Draft": false,
"IsHome": false,
"Keywords": null,
"Kind": "section",
"Layout": "",
"LinkTitle": "Card",
"IsNode": true,
"IsPage": false,
"Path": "/shortcodes/card",
"Slug": "",
"Lang": "en",
"IsSection": true,
"Section": "shortcodes",
"Sitemap": {
"ChangeFreq": "",
"Priority": -1,
"Filename": "sitemap.xml",
"Disable": false
},
"Type": "shortcodes",
"Weight": 0
},
"TableOfContentsProvider": {
"Date": "0001-01-01T00:00:00Z",
"Lastmod": "0001-01-01T00:00:00Z",
"PublishDate": "0001-01-01T00:00:00Z",
"ExpiryDate": "0001-01-01T00:00:00Z",
"Aliases": null,
"BundleType": "branch",
"Description": "Show rrrambl'n 'n a card",
"Draft": false,
"IsHome": false,
"Keywords": null,
"Kind": "section",
"Layout": "",
"LinkTitle": "Card",
"IsNode": true,
"IsPage": false,
"Path": "/shortcodes/card",
"Slug": "",
"Lang": "en",
"IsSection": true,
"Section": "shortcodes",
"Sitemap": {
"ChangeFreq": "",
"Priority": -1,
"Filename": "sitemap.xml",
"Disable": false
},
"Type": "shortcodes",
"Weight": 0
},
"MarkupProvider": 0,
"ContentProvider": 0
},
"params": {
"blub": "bla"
},
"style": "filled",
"template": "debug",
"title": ""
}