feat: add support for icon in badge shortcode (#525)

* feat: add icon support to badge shortcodes

- Introduced an optional icon parameter to both badge.html files.
- Updated the badge rendering to include the icon alongside the content.
- Enhanced the layout for better alignment of icon and text.

* feat: add new feature shortcode

* docs: update badge doc
This commit is contained in:
Xin
2024-12-28 13:50:22 +00:00
committed by GitHub
parent 26a298da5d
commit 79bb4504a0
4 changed files with 22 additions and 5 deletions

View File

@ -3,6 +3,7 @@
{{- $type := .Get "type" | default "" -}}
{{- $class := .Get "class" | default "" -}}
{{- $link := .Get "link" | default "" -}}
{{- $icon := .Get "icon" | default "" -}}
{{- if $link -}}
<a href="{{ $link }}" title="{{ $content | plainify }}" target="_blank">
@ -11,6 +12,7 @@
"type" $type
"class" $class
"border" true
"icon" $icon
)
-}}
</a>
@ -20,6 +22,7 @@
"type" $type
"class" $class
"border" true
"icon" $icon
)
-}}
{{- end -}}