From aed63c6f967c43c1337fb2df850f37f715b7ed7f Mon Sep 17 00:00:00 2001
From: Martin Hellspong <martin.hellspong@factor10.com>
Date: Thu, 05 Jan 2023 12:21:07 +0000
Subject: [PATCH] Add custom title / translation of authors (#756)

---
 layouts/posts/single.html                                |    2 +-
 exampleSite/content/posts/markdown-syntax.pt-br.md       |    2 +-
 layouts/partials/taxonomy/authors.html                   |    2 +-
 exampleSite/content/authors/hugo-authors/_index.pt-br.md |    6 ++++++
 exampleSite/content/authors/hugo-authors/_index.md       |    5 +++++
 exampleSite/content/posts/markdown-syntax.md             |    2 +-
 6 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/exampleSite/content/authors/hugo-authors/_index.md b/exampleSite/content/authors/hugo-authors/_index.md
new file mode 100644
index 0000000..80d4ea8
--- /dev/null
+++ b/exampleSite/content/authors/hugo-authors/_index.md
@@ -0,0 +1,5 @@
++++ 
+draft = false
+date = 2023-01-05T01:15:29+01:00
+title = "Authors of Hugo"
++++
diff --git a/exampleSite/content/authors/hugo-authors/_index.pt-br.md b/exampleSite/content/authors/hugo-authors/_index.pt-br.md
new file mode 100644
index 0000000..1c42b81
--- /dev/null
+++ b/exampleSite/content/authors/hugo-authors/_index.pt-br.md
@@ -0,0 +1,6 @@
++++ 
+draft = false
+date = 2023-01-05T01:15:52+01:00
+title = "Autores de Hugo"
+url = "autores/autores-de-hugo" 
++++
diff --git a/exampleSite/content/posts/markdown-syntax.md b/exampleSite/content/posts/markdown-syntax.md
index a61a239..a297505 100644
--- a/exampleSite/content/posts/markdown-syntax.md
+++ b/exampleSite/content/posts/markdown-syntax.md
@@ -1,5 +1,5 @@
 +++
-author = "Hugo Authors"
+authors = ["Hugo Authors"]
 title = "Markdown Syntax Guide"
 date = "2019-03-11"
 description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements."
diff --git a/exampleSite/content/posts/markdown-syntax.pt-br.md b/exampleSite/content/posts/markdown-syntax.pt-br.md
index 0ca36ae..90ed451 100644
--- a/exampleSite/content/posts/markdown-syntax.pt-br.md
+++ b/exampleSite/content/posts/markdown-syntax.pt-br.md
@@ -1,5 +1,5 @@
 +++
-author = "Hugo Authors"
+authors = ["Hugo Authors"]
 title = "Guia de Sintaxe Markdown"
 date = "2019-03-11"
 description = "Artigo de exemplo mostrando a sintaxe básica Markdown e a formatação de elementos HTML."
diff --git a/layouts/partials/taxonomy/authors.html b/layouts/partials/taxonomy/authors.html
index cdb7a4f..bfd6b0c 100644
--- a/layouts/partials/taxonomy/authors.html
+++ b/layouts/partials/taxonomy/authors.html
@@ -4,6 +4,6 @@
     {{- if gt $index 0 }}
       <span class="separator">•</span>
     {{- end }}
-    <a href="{{ ( printf "authors/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
+    <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
   {{- end -}}
 </div>
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index 38fd3b9..655cf95 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -25,7 +25,7 @@
               {{ i18n "reading_time" .ReadingTime }}
             </span>
           </div>
-          {{ with .Page.Params.Authors }}{{ partial "taxonomy/authors.html" . }}{{ end }}
+          {{ with .GetTerms "authors" }}{{ partial "taxonomy/authors.html" . }}{{ end }}
           {{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }}
           {{ with .GetTerms "tags" }}{{ partial "taxonomy/tags.html" . }}{{ end }}
         </div>

--
Gitblit v1.10.0