diff options
author | Dillon <dillonzq@outlook.com> | 2020-02-03 06:46:30 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2020-02-03 06:46:30 +0300 |
commit | 8aba2262906628f38f114a9947783bc6c7fd7495 (patch) | |
tree | 445b65d993aa2e82c2e6c97c48fb23fd6d1bd053 /layouts/_default/single.html | |
parent | b91ca3d61ac77d3bec257325682a82729e00890d (diff) |
feat(partial): add hook and image partial
Diffstat (limited to 'layouts/_default/single.html')
-rw-r--r-- | layouts/_default/single.html | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4eebf85..314e4db 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,33 +6,7 @@ {{- .Title -}} </h1> <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> </div> {{- end -}}
\ No newline at end of file |