Extract gmi processed content into its own partial
This commit is contained in:
parent
e7b575b071
commit
f822e1444e
|
@ -0,0 +1,11 @@
|
|||
{{- /*
|
||||
* https://discourse.gohugo.io/t/using-renderstring-to-expand-shortcodes/40994/7
|
||||
* support for using shortcodes in gemtext whilst having content as raw text.
|
||||
*/ -}}
|
||||
{{- $content := printf "~~~\n\n%s\n~~~" (trim (readFile (replace $.File.Path ".md" ".gmi")) "\n" | safeHTML) | .Page.RenderString | htmlUnescape }}
|
||||
{{- $lines := split $content "\n" }}
|
||||
{{- range $i, $_ := $lines }}
|
||||
{{- if and $i (ne $i (sub (len $lines) 1)) }}
|
||||
{{ . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -18,18 +18,7 @@ Tag:
|
|||
{{- if $index -}}, {{ end -}}{{ if (not $index) }}{{printf " "}}{{end}}{{ $tag | urlize }}{{- end -}}{{- end }}
|
||||
{{- end }}
|
||||
--
|
||||
|
||||
{{- /*
|
||||
* https://discourse.gohugo.io/t/using-renderstring-to-expand-shortcodes/40994/7
|
||||
* support for using shortcodes in gemtext whilst having content as raw text.
|
||||
*/ -}}
|
||||
{{- $content := printf "~~~\n%s~~~" (trim (readFile (replace $.File.Path ".md" ".gmi")) "\n" | safeHTML) | .Page.RenderString | htmlUnescape }}
|
||||
{{- $lines := split $content "\n" }}
|
||||
{{- range $i, $_ := $lines }}
|
||||
{{- if and $i (ne $i (sub (len $lines) 1)) }}
|
||||
{{ . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ partial "processed-content.gmi" . }}
|
||||
|
||||
--
|
||||
Questions/comments:
|
||||
|
|
Loading…
Reference in New Issue