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
No known key found for this signature in database
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 - Open Source
- Development - Development
resources: 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 - name: testimage
src: "images/testimage.jpg" src: "images/testimage.jpg"
title: This is a test image title: This is a test image

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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