feat: add badge shortcode (#457)

* feat: move badge to a separate partial

* feat: badge shortcode

* docs: add badge shortcode examples

* chore: generate css

* docs: add spaces between badges
This commit is contained in:
Xin
2024-09-22 22:12:22 +01:00
committed by GitHub
parent cabdb421e3
commit c70900c25f
9 changed files with 104 additions and 12 deletions

View File

@ -10,6 +10,41 @@ sidebar:
These shortcodes are considered less stable and may be changed anytime.
{{< /callout >}}
## Badge
```
{{</* badge "Badge" */>}}
```
Result:
{{< badge "Badge" >}}
Variants:
```
{{</* badge content="info" type="info" */>}}
{{</* badge content="warning" type="warning" */>}}
{{</* badge content="error" type="error" */>}}
```
Result:
{{< badge content="info" type="info" >}} &nbsp;
{{< badge content="warning" type="warning" >}} &nbsp;
{{< badge content="error" type="error" >}}
With link:
```
{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" */>}}
```
Result:
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" >}}
## YouTube
Embed a YouTube video.

View File

@ -209,6 +209,7 @@
"group-hover:hx-underline",
"group-open:before:hx-rotate-90",
"hamburger-menu",
"hextra-badge",
"hextra-card",
"hextra-card-icon",
"hextra-card-image",
@ -464,6 +465,7 @@
"hx-sticky",
"hx-text-2xl",
"hx-text-4xl",
"hx-text-[.65rem]",
"hx-text-[10px]",
"hx-text-[color:hsl(var(--primary-hue),100%,50%)]",
"hx-text-base",
@ -488,7 +490,6 @@
"hx-text-white",
"hx-text-xl",
"hx-text-xs",
"hx-text-xxs",
"hx-text-yellow-900",
"hx-to-gray-600",
"hx-top-0",