feat(partial): add hook and image partial
This commit is contained in:
@@ -39,8 +39,7 @@
|
||||
|
||||
{{- with .Params.featured_image -}}
|
||||
<div class="post-featured-image">
|
||||
{{- $res := resources.Get "svg/loading.svg" | minify -}}
|
||||
<img src="{{ $res.RelPermalink }}" data-sizes="auto" data-src="{{ . }}" alt="featured image" class="lazyload">
|
||||
{{- partial "image" . -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
@@ -70,33 +69,7 @@
|
||||
{{- end -}}
|
||||
|
||||
<div class="post-content">
|
||||
{{- $content := .Content -}}
|
||||
|
||||
{{- $REin := `:\(([\w- ]+?)\):` -}}
|
||||
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- $REin = `\[(.+?)\]\^\((.+?)\)` -}}
|
||||
{{- $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- $REin = `<sup>\[return\]</sup>` -}}
|
||||
{{- $REout = `↩︎` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- $REin = `<(h[23456]) (id=".+?")>` -}}
|
||||
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- $REin = `<(.+?) (id="fnref:.+?")>` -}}
|
||||
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- $REin = `<li (id="fn:.+?")(.*?)>\s?<p>` -}}
|
||||
{{- $REout = `<li $2><p><a class="post-dummy-target" $1></a>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- $content | safeHTML -}}
|
||||
{{- partial "hook/content.html" .Content | safeHTML -}}
|
||||
</div>
|
||||
|
||||
{{- partial "post/footer.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user