feat: add markdown alerts support (#1221)
* Markdown alerts * refactor(alert): move alert color to variable.scss and simplify the style * style: fix indent in render-blockquote * feat(alert): add customizable alert icons for different alert types * doc: add example usage of markdown alert --------- Co-authored-by: Jimmy Cai <jimmy@cai.im>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{{- $type := .AlertType -}}
|
||||
{{- $icons := site.Params.article.alertIcon -}}
|
||||
{{- $icon := index $icons $type -}}
|
||||
|
||||
<blockquote class="{{ if $type }}alert alert-{{ $type }}{{ end }}">
|
||||
{{- if $type -}}
|
||||
<div class="alert-header">
|
||||
<span class="alert-icon">
|
||||
{{- $icon -}}
|
||||
</span>
|
||||
<span class="alert-title">
|
||||
{{- title $type -}}
|
||||
</span>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
<div class="alert-body">
|
||||
{{ .Text }}
|
||||
</div>
|
||||
</blockquote>
|
||||
Reference in New Issue
Block a user