Support alerts (notes, warnings, rationales)
This commit is contained in:
parent
ab64bda76d
commit
338434bfcd
22 changed files with 194 additions and 138 deletions
20
layouts/partials/alert.html
Normal file
20
layouts/partials/alert.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{{/*
|
||||
|
||||
Display an alert box of the given type, containing the given content.
|
||||
|
||||
Supported types are "warning", "info", and "rationale".
|
||||
The type determines the colors used in the box and, by default,
|
||||
the title for the box: WARNING, INFO, RATIONALE.
|
||||
|
||||
By passing "omit_title", a caller can suppress the title, and just get
|
||||
a box using the colors and styles for the given type.
|
||||
|
||||
*/}}
|
||||
|
||||
{{ $type := .type}}
|
||||
{{ $content := .content}}
|
||||
{{ $omit_title := .omit_title }}
|
||||
|
||||
<div class="alert {{ $type }} {{ if $omit_title }}omit-title{{end}}" role="alert">
|
||||
{{ $content | markdownify }}
|
||||
</div>
|
1
layouts/shortcodes/boxes/note.html
Normal file
1
layouts/shortcodes/boxes/note.html
Normal file
|
@ -0,0 +1 @@
|
|||
{{ partial "alert" (dict "type" "note" "content" .Inner) }}
|
1
layouts/shortcodes/boxes/rationale.html
Normal file
1
layouts/shortcodes/boxes/rationale.html
Normal file
|
@ -0,0 +1 @@
|
|||
{{ partial "alert" (dict "type" "rationale" "content" .Inner) }}
|
1
layouts/shortcodes/boxes/warning.html
Normal file
1
layouts/shortcodes/boxes/warning.html
Normal file
|
@ -0,0 +1 @@
|
|||
{{ partial "alert" (dict "type" "warning" "content" .Inner) }}
|
Loading…
Add table
Add a link
Reference in a new issue