diff --git a/exampleSite/content/shortcodes/notice.en.md b/exampleSite/content/shortcodes/notice.en.md index 5a8c8360c0..c888bce87a 100644 --- a/exampleSite/content/shortcodes/notice.en.md +++ b/exampleSite/content/shortcodes/notice.en.md @@ -39,8 +39,8 @@ It is all about the boxes. | Name | Position | Optional | Default | Notes | |:----------|:---------|:----------|:----------|:------------| | **style** | 1 | yes | `default` | The color scheme used to highlight the box content.

- by severity: `info`, `note`, `tip`, `warning`
- by brand color: `primary`, `secondary`
- by color: `blue`, `green`, `grey`, `orange`, `red`
- by special color: `default`, `transparent` | -| **title** | 2 | yes | see notes | Arbitray text for the box title. Depending on the **style** there may be a default title. Any given value will overwrite the default.

- for severity styles: the matching title for the severity
- for all other colors: no title

If you want no title for a severity style, you have to set this parameter to `" "` (a non empty string filled with spaces) | -| **icon** | 3 | yes | see notes | [Font Awesome icon name]({{%relref "cont/icons#finding-an-icon" %}}) set to the left of the title. Depending on the **style** there may be a default icon. Any given value will overwrite the default.

- for severity styles: a nice matching icon for the severity
- for all other colors: no icon

If you want no icon for a severity style, you have to set this parameter to `" "` (a non empty string filled with spaces) | +| **title** | 2 | yes | see notes | Arbitray text for the box title. Depending on the **style** there may be a default title. Any given value will overwrite the default.

- for severity styles: the matching title for the severity
- for all other colors: _<empty>_

If you want no title for a severity style, you have to set this parameter to `" "` (a non empty string filled with spaces) | +| **icon** | 3 | yes | see notes | [Font Awesome icon name]({{%relref "cont/icons#finding-an-icon" %}}) set to the left of the title. Depending on the **style** there may be a default icon. Any given value will overwrite the default.

- for severity styles: a nice matching icon for the severity
- for all other colors: _<empty>_

If you want no icon for a severity style, you have to set this parameter to `" "` (a non empty string filled with spaces) | ## Examples diff --git a/layouts/shortcodes/notice.html b/layouts/shortcodes/notice.html index 29eae15d4b..88e0120ab2 100644 --- a/layouts/shortcodes/notice.html +++ b/layouts/shortcodes/notice.html @@ -6,11 +6,14 @@ {{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }} {{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }} {{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }} - {{- if eq $style "tip" }}{{ $icon = default "lightbulb " }}{{ end }} + {{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }} {{- end }} {{- $icon = trim $icon " " }} -
-
{{ if $icon }} {{ end }}{{ $title }}
+{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }} + {{- $icon = printf "fa-fw fas fa-%s" $icon }} +{{- end }} +
+
{{ if $icon }} {{ end }}{{ $title }}
{{ .Inner }}
\ No newline at end of file