fix: inline stack theme
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
{{ if eq .Type "alert" }}
|
||||
{{- $type := .AlertType -}}
|
||||
{{- $icons := site.Params.article.alertIcon -}}
|
||||
{{- $icon := index $icons $type -}}
|
||||
<blockquote class="alert alert-{{ $type }}">
|
||||
<div class="alert-header">
|
||||
<span class="alert-icon">
|
||||
{{- $icon -}}
|
||||
</span>
|
||||
<span class="alert-title">
|
||||
{{- with .AlertTitle -}}
|
||||
{{ . }}
|
||||
{{- else -}}
|
||||
{{ or (i18n (printf "article.alert.%s" $type)) (title $type) }}
|
||||
{{- end -}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="alert-body">
|
||||
{{ .Text }}
|
||||
</div>
|
||||
</blockquote>
|
||||
{{ else }}
|
||||
<blockquote>
|
||||
{{ .Text }}
|
||||
</blockquote>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,4 @@
|
||||
<pre class="mermaid" style="visibility:hidden">
|
||||
{{- .Inner | safeHTML -}}
|
||||
</pre>
|
||||
{{- .Page.Store.Set "hasMermaid" true -}}
|
||||
@@ -0,0 +1,6 @@
|
||||
<h{{ .Level }} id="{{ .Anchor }}">
|
||||
{{- if site.Params.Article.HeadingAnchor -}}
|
||||
<a href="#{{ .Anchor }}" class="header-anchor"></a>
|
||||
{{- end -}}
|
||||
{{ .Text | safeHTML }}
|
||||
</h{{ .Level }}>
|
||||
@@ -0,0 +1,30 @@
|
||||
{{- $image := partial "helper/image" (dict "Resources" .Page.Resources "Image" .Destination "Context" .Page) -}}
|
||||
{{- $alt := .PlainText | safeHTML -}}
|
||||
{{- $title := .Title | markdownify -}}
|
||||
|
||||
{{/* There are some types of images that don't have width and height attributes, such as SVG */}}
|
||||
{{- $galleryImage := and $image.Height $image.Width -}}
|
||||
|
||||
{{- $attributes := dict -}}
|
||||
{{- if $galleryImage -}}
|
||||
{{- $attributes = (dict
|
||||
"data-flex-grow" (div (mul $image.Width 100) $image.Height)
|
||||
"data-flex-basis" (printf "%dpx" (div (mul $image.Width 240) $image.Height))
|
||||
) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ partial "helper/responsive-image" (dict
|
||||
"Resource" $image.Resource
|
||||
"Widths" (cond .Page.Site.Params.ImageProcessing.Content.Enabled .Page.Site.Params.ImageProcessing.Content.Widths nil)
|
||||
"Attributes" (merge $attributes (dict
|
||||
"src" $image.Permalink
|
||||
"width" $image.Width
|
||||
"height" $image.Height
|
||||
"alt" $alt
|
||||
"title" $title
|
||||
"data-title-escaped" ($title | htmlEscape)
|
||||
"class" (cond $galleryImage "gallery-image" "")
|
||||
"loading" "lazy"
|
||||
"sizes" "(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px"
|
||||
))
|
||||
) }}
|
||||
@@ -0,0 +1,3 @@
|
||||
<a class="link" href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}"
|
||||
{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"
|
||||
{{ end }}>{{ .Text | safeHTML }}</a>
|
||||
Reference in New Issue
Block a user