Images working
This commit is contained in:
@@ -3,12 +3,17 @@
|
|||||||
{{ $content = $content | replaceRE `<!--more-->\n+` "" -}}
|
{{ $content = $content | replaceRE `<!--more-->\n+` "" -}}
|
||||||
{{ $content = $content | replaceRE `\[([^\]]+)\]\[(\d+)\]` "$1[$2]" -}}
|
{{ $content = $content | replaceRE `\[([^\]]+)\]\[(\d+)\]` "$1[$2]" -}}
|
||||||
{{ $content = $content | replaceRE `(?m)^\[(\d+)\]: (.*)$` "=> $2 [$1] $2" -}}
|
{{ $content = $content | replaceRE `(?m)^\[(\d+)\]: (.*)$` "=> $2 [$1] $2" -}}
|
||||||
{{ $content = $content | replaceRE `(?m)\n\n >` "\n\n" -}}
|
{{ $content = $content | replaceRE `(?m)\n\n >` "\n\n>" -}}
|
||||||
{{ $content = $content | replaceRE `(?m)\n\n ([^>])` " $1" -}}
|
{{ $content = $content | replaceRE `(?m)\n\n ([A-Z])` " $1" -}}
|
||||||
{{ $audioRE := `<audio controls src="(.*/([^"]+))"></audio>` }}
|
{{ $audioRE := `<audio controls src="(.*/([^"]+))"></audio>` }}
|
||||||
{{ range findRE $audioRE $content -}}
|
{{ range findRE $audioRE $content -}}
|
||||||
{{ $url := . | replaceRE $audioRE "$1" | replaceRE ` ` "%20" -}}
|
{{ $url := . | replaceRE $audioRE "$1" | replaceRE ` ` "%20" -}}
|
||||||
{{ $title := . | replaceRE $audioRE "$2" -}}
|
{{ $title := . | replaceRE $audioRE "$2" -}}
|
||||||
{{ $content = replace $content . (printf "=> %s %s" $url $title) -}}
|
{{ $content = replace $content . (printf "=> %s %s" $url $title) -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
{{ range findRE `{{<(dither|thumbnail) [^/]+/>}}` $content -}}
|
||||||
|
{{ $rendered := $.Page.RenderString . -}}
|
||||||
|
{{ $url := $rendered | replaceRE `(?s).*src="([^"]+)".*` "=> $1" -}}
|
||||||
|
{{ $content = replace $content . $url -}}
|
||||||
|
{{ end -}}
|
||||||
{{ $content | safeHTML }}
|
{{ $content | safeHTML }}
|
||||||
|
|||||||
Reference in New Issue
Block a user