mirror of
https://github.com/imfing/hextra.git
synced 2025-08-24 05:37:15 -04:00
feat: basic github style alerts support
This commit is contained in:
20
layouts/_default/_markup/render-blockquote-alert.html
Normal file
20
layouts/_default/_markup/render-blockquote-alert.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- $supportedAlertTypes := slice "note" "tip" "important" "warning" "caution" -}}
|
||||
{{- $emojis := dict
|
||||
"note" ":memo:"
|
||||
"tip" ":bulb:"
|
||||
"important" ":information_source:"
|
||||
"warning" ":warning:"
|
||||
"caution" ":exclamation:"
|
||||
-}}
|
||||
|
||||
{{- if not (in $supportedAlertTypes .AlertType) -}}
|
||||
<blockquote>
|
||||
{{- .Text -}}
|
||||
</blockquote>
|
||||
{{- else -}}
|
||||
{{- $emoji := emojify (index $emojis .AlertType) -}}
|
||||
{{- $content := .Text -}}
|
||||
{{- $icon := "" -}}
|
||||
{{- $class := "" -}}
|
||||
{{- partial "shortcodes/callout.html" (dict "content" $content "emoji" $emoji "icon" $icon "class" $class) -}}
|
||||
{{- end -}}
|
3
layouts/_default/_markup/render-blockquote-regular.html
Normal file
3
layouts/_default/_markup/render-blockquote-regular.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<blockquote>
|
||||
{{ .Text }}
|
||||
</blockquote>
|
Reference in New Issue
Block a user