mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
feat: add support for center-aligned alerts in admonition syntax (#640)
This commit is contained in:
@@ -154,3 +154,8 @@ This is the default example type admonition.
|
||||
{{< admonition quote "" false >}}
|
||||
This is the default quote type admonition. Aliases: `cite`
|
||||
{{< /admonition >}}
|
||||
|
||||
## Special Types
|
||||
|
||||
> [!center]
|
||||
> This paragraph is **center-aligned**.
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{{- $basicTypes := slice "note" "tip" "important" "warning" "caution" -}}
|
||||
|
||||
{{- if .AlertTitle | or .AlertSign | or (.AlertType | in $basicTypes | not) -}}
|
||||
{{- if eq .AlertType "center" -}}
|
||||
{{- /* The "center" type is a special case for centering content. */ -}}
|
||||
<blockquote class="blockquote-center">{{ .Text }}</blockquote>
|
||||
{{- else if .AlertTitle | or .AlertSign | or (.AlertType | in $basicTypes | not) -}}
|
||||
{{- /* The extended syntax is compatible with Obsidian and FixIt admonition shortcode. */ -}}
|
||||
{{- $openMap := dict "+" true "-" false -}}
|
||||
{{- $open := index $openMap .AlertSign | default true -}}
|
||||
|
||||
Reference in New Issue
Block a user