fix: replace markdownify with renderString to use render hooks

This commit is contained in:
Robert Kaussow 2021-02-21 13:45:21 +01:00
parent 81bd7f2549
commit 582d84408e
Signed by: xoxys
GPG Key ID: 65362AE74AF98B61
9 changed files with 11 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

View File

@ -8,6 +8,10 @@ tags:
- Open Source
- Development
resources:
- name: feature
src: "images/feature.jpg"
params:
credits: "[Angelina Litvin](https://unsplash.com/@linalitvina) on [Unsplash](https://unsplash.com/s/photos/writing)"
- name: testimage
src: "images/testimage.jpg"
title: This is a test image

View File

@ -51,7 +51,7 @@
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ $desc := .Description | default "" }}
{{ $description := (cond (eq "" $desc) "" (printf "<blockquote>%s</blockquote>" ($desc | markdownify))) }}
{{ $description := (cond (eq "" $desc) "" (printf "<blockquote>%s</blockquote>" ($desc | $.Page.RenderString))) }}
{{ printf `<content type="html"><![CDATA[%s%s]]></content>` $description .Content | safeHTML }}
{{ with .Site.Taxonomies }}
{{ range $taxo,$_ := . }} <!-- Defaults taxos: "tags", "categories" -->

View File

@ -10,7 +10,7 @@
<img src="{{ $featured.Permalink }}" alt="{{ default $.Title .Params.description }}" >
</picture>
{{ with $source.Params.credits }}
<span>Credits: {{ . | markdownify | safeHTML }}</span>
<span>Credits: {{ . | $.Page.RenderString | safeHTML }}</span>
{{ end }}
</div>
{{ end }}

View File

@ -1,7 +1,7 @@
<div class="gblog-columns flex flex-wrap">
{{ range split .Inner "<--->" }}
<div class="gblog-columns__content gblog-markdown--nested flex-even">
{{ . | markdownify }}
{{ . | $.Page.RenderString }}
</div>
{{ end }}
</div>

View File

@ -6,6 +6,6 @@
</label>
<input id="{{ $id }}-{{ .Ordinal }}" type="checkbox" class="gblog-expand__control hidden" />
<div class="gblog-markdown--nested gblog-expand__content">
{{ .Inner | markdownify }}
{{ .Inner | $.Page.RenderString }}
</div>
</div>

View File

@ -1,3 +1,3 @@
<blockquote class="gblog-hint {{ .Get 0 }}">
{{ .Inner | markdownify }}
{{ .Inner | $.Page.RenderString }}
</blockquote>

View File

@ -31,7 +31,7 @@
{{ end }}/>
</a>
{{ with $caption }}
<figcaption>{{ . }}{{ with $source.Params.credits }} ({{ . | markdownify }}){{ end }}</figcaption>
<figcaption>{{ . }}{{ with $source.Params.credits }} ({{ . | $.Page.RenderString }}){{ end }}</figcaption>
{{ end }}
</figure>
</div>

View File

@ -10,7 +10,7 @@
{{ $tab.Name }}
</label>
<div class="gblog-markdown--nested gblog-tabs__content">
{{ .Content | markdownify }}
{{ .Content | $.Page.RenderString }}
</div>
{{ end }}
</div>