Skip to content

Commit 11e1182

Browse files
fix: issue-698 author link not working in quote post (#699)
1 parent 0233e0f commit 11e1182

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

v4/archetypes/quote.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
date: {{ .Date }}
4+
draft: true
5+
6+
author: ""
7+
quoteAuthor: ""
8+
quoteAuthorLink: ""
9+
categories: []
10+
tags: []
11+
---

v4/exampleSite/content/quote/edward-snowden-privacy.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: "Edward Snowden About Privacy"
33
date: 2021-11-01T13:01:14+01:00
44

5-
author: "Edward Snowden"
5+
author: "Lednerb"
6+
quoteAuthor: "Edward Snowden"
7+
quoteAuthorLink: "https://en.wikipedia.org/wiki/Edward_Snowden"
68
categories: ['Privacy', 'Society']
79
tags: ['free speech']
810
---

v4/exampleSite/content/quote/einstein-sinn-des-lebens.de.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: "Albert Einstein - Sinn Des Lebens"
33
date: 2021-11-01T14:40:32+01:00
44

5+
author: "Lednerb"
6+
quoteAuthor: "Albert Einstein"
7+
quoteAuthorLink: "https://de.wikipedia.org/wiki/Albert_Einstein"
58
categories: ['Zitate']
6-
author: "Albert Einstein"
79
---
810
Der Sinn des Lebens besteht nicht darin ein erfolgreicher Mensch zu sein, sondern ein wertvoller.

v4/layouts/partials/content-type/quote.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99

1010
<blockquote>
1111
{{ .ctx.Content }}
12-
{{ $urlValue := replace .ctx.Params.author " " "-" | lower}}
1312
<cite>
14-
<a href="{{ (print "/author/" $urlValue) | relLangURL }}">
15-
{{ .ctx.Params.author }}
16-
</a>
13+
{{ if .ctx.Params.quoteAuthorLink }}
14+
<a href="{{ .ctx.Params.quoteAuthorLink }}" target="_blank" rel="noopener noreferrer">
15+
{{ .ctx.Params.quoteAuthor }}
16+
</a>
17+
{{ else }}
18+
{{ .ctx.Params.quoteAuthor }}
19+
{{ end }}
1720
</cite>
1821
</blockquote>
19-
</article>
22+
</article>

0 commit comments

Comments
 (0)