mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-21 20:50:40 +00:00
fix: replace markdownify with renderString to use render hooks
This commit is contained in:
parent
81bd7f2549
commit
582d84408e
BIN
exampleSite/content/posts/post-with-images/images/feature.jpg
Normal file
BIN
exampleSite/content/posts/post-with-images/images/feature.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 182 KiB |
@ -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
|
||||||
|
@ -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" -->
|
||||||
|
@ -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 }}
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<blockquote class="gblog-hint {{ .Get 0 }}">
|
<blockquote class="gblog-hint {{ .Get 0 }}">
|
||||||
{{ .Inner | markdownify }}
|
{{ .Inner | $.Page.RenderString }}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user