🚸 Allow icon to be specified in `alert` shortcode

pull/156/head
James Panther 2022-03-09 15:14:09 +11:00
parent c1857711ed
commit e5021c9d30
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
3 changed files with 12 additions and 1 deletions

View File

@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Markdown images and `figure` shortcode now search the `assets/` directory if an image cannot be found in page bundle ([#126](https://github.com/jpanther/congo/issues/126))
- Markdown images and `figure` shortcode now fallback to static assets if an image is not provided as a Hugo resource ([#126](https://github.com/jpanther/congo/issues/126))
- Taxonomy term listings now honour the `groupByYear` parameter ([#145](https://github.com/jpanther/congo/pull/145))
- The `alert` shortcode now allows its icon to be specified as a parameter
## [2.0.5] - 2022-02-20

View File

@ -15,17 +15,27 @@ In addition to all the [default Hugo shortcodes](https://gohugo.io/content-manag
The input is written in Markdown so you can format it however you please.
By default, the alert is presented with an exclaimation triangle icon. To change the icon, include the icon name in the shortcode. Check out the [icon shortcode](#icon) for more details on using icons.
**Example:**
```md
{{</* alert */>}}
**Warning!** This action is destructive!
{{</* /alert */>}}
{{</* alert "twitter" */>}}
Don't forget to [follow me](https://twitter.com/jpanther) on Twitter.
{{</* /alert */>}}
```
{{< alert >}}
**Warning!** This action is destructive!
{{< /alert >}}
&nbsp;
{{< alert "twitter" >}}
Don't forget to [follow me](https://twitter.com/jpanther) on Twitter.
{{< /alert >}}
## Badge

View File

@ -1,6 +1,6 @@
<div class="flex px-4 py-3 rounded-md bg-primary-100 dark:bg-primary-900">
<span class="ltr:pr-3 rtl:pl-3 text-primary-400">
{{ partial "icon.html" "exclamation-triangle" }}
{{ partial "icon.html" (.Get 0 | default "exclamation-triangle") }}
</span>
<span class="dark:text-neutral-300">
{{- .Inner | markdownify -}}