mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Add authors taxonomy for blog posts (#435)
* Add authors taxonomy and layout * Add my name to contributors file * Add authors to front matter post archetypes * Add author to i18n for en * Add authors taxonomy to exampleSite config * Add some author names to exampleSite for demo * Tested authors on pt-br and externally-linked post * Also ran make release again * Resources Deleted resources in exampleSite and added resources in root
This commit is contained in:
@@ -81,4 +81,5 @@
|
|||||||
- [Rabin Adhikari](https://github.com/rabinadk1/)
|
- [Rabin Adhikari](https://github.com/rabinadk1/)
|
||||||
- [Hussaini Zulkifli](https://github.com/hussaini/)
|
- [Hussaini Zulkifli](https://github.com/hussaini/)
|
||||||
- [Ellison Leão](https://github.com/ellisonleao)
|
- [Ellison Leão](https://github.com/ellisonleao)
|
||||||
- [Lucas de Oliveira](https://github.com/lucas-dOliveira)
|
- [Lucas de Oliveira](https://github.com/lucas-dOliveira)
|
||||||
|
- [earnest ma](https://github.com/earnestma)
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ draft = true
|
|||||||
date = {{ .Date }}
|
date = {{ .Date }}
|
||||||
title = ""
|
title = ""
|
||||||
description = ""
|
description = ""
|
||||||
slug = ""
|
slug = ""
|
||||||
|
authors = []
|
||||||
tags = []
|
tags = []
|
||||||
categories = []
|
categories = []
|
||||||
externalLink = ""
|
externalLink = ""
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ disqusShortname = "yourdiscussshortname"
|
|||||||
category = "categories"
|
category = "categories"
|
||||||
series = "series"
|
series = "series"
|
||||||
tag = "tags"
|
tag = "tags"
|
||||||
|
author = "authors"
|
||||||
|
|
||||||
[[params.social]]
|
[[params.social]]
|
||||||
name = "Github"
|
name = "Github"
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
+++
|
+++
|
||||||
date = "2014-09-28"
|
date = "2014-09-28"
|
||||||
title = "Creating a New Theme"
|
title = "Creating a New Theme"
|
||||||
slug = "creating-a-new-theme"
|
slug = "creating-a-new-theme"
|
||||||
tags = []
|
tags = []
|
||||||
categories = []
|
categories = []
|
||||||
series = ["Theme", "Hugo"]
|
series = ["Theme", "Hugo"]
|
||||||
|
authors = ["John Doe"]
|
||||||
+++
|
+++
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ title = "Dummy"
|
|||||||
slug = "dummy"
|
slug = "dummy"
|
||||||
tags = ["hugo", "i18n"]
|
tags = ["hugo", "i18n"]
|
||||||
categories = ["blog"]
|
categories = ["blog"]
|
||||||
|
authors = ["Translation test"]
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Nada para ver aqui!
|
Nada para ver aqui!
|
||||||
@@ -12,4 +12,5 @@ categories = [
|
|||||||
]
|
]
|
||||||
externalLink = "https://github.com/luizdepra/hugo-coder/wiki"
|
externalLink = "https://github.com/luizdepra/hugo-coder/wiki"
|
||||||
series = ["Hugo"]
|
series = ["Hugo"]
|
||||||
|
authors = ["External link test"]
|
||||||
+++
|
+++
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ categories = [
|
|||||||
"golang",
|
"golang",
|
||||||
]
|
]
|
||||||
series = ["Getting Started", "Hugo"]
|
series = ["Getting Started", "Hugo"]
|
||||||
|
authors = ["Jane Smith"]
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for
|
Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ description = "The post demonstrates features of the coder theme."
|
|||||||
images = ["/images/N90.jpg"]
|
images = ["/images/N90.jpg"]
|
||||||
math = true
|
math = true
|
||||||
series = ["Theme", "Hugo"]
|
series = ["Theme", "Hugo"]
|
||||||
|
authors = ["John Doe", "Jane Smith"]
|
||||||
+++
|
+++
|
||||||
|
|
||||||
## Style Demo
|
## Style Demo
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ other = "tag"
|
|||||||
[series]
|
[series]
|
||||||
other = "series"
|
other = "series"
|
||||||
|
|
||||||
|
[author]
|
||||||
|
other = "author"
|
||||||
|
|
||||||
[reading_time]
|
[reading_time]
|
||||||
one = "One-minute read"
|
one = "One-minute read"
|
||||||
other = "{{ .Count }}-minute read"
|
other = "{{ .Count }}-minute read"
|
||||||
|
|||||||
9
layouts/partials/taxonomy/authors.html
Normal file
9
layouts/partials/taxonomy/authors.html
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<div class="authors">
|
||||||
|
<i class="fa fa-user" aria-hidden="true"></i>
|
||||||
|
{{- range $index, $el := . -}}
|
||||||
|
{{- if gt $index 0 }}
|
||||||
|
<span class="separator">•</span>
|
||||||
|
{{- end }}
|
||||||
|
<a href="{{ ( printf "authors/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
{{ i18n "reading_time" .ReadingTime }}
|
{{ i18n "reading_time" .ReadingTime }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
{{ with .Page.Params.Authors }}{{ partial "taxonomy/authors.html" . }}{{ end }}
|
||||||
{{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }}
|
{{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }}
|
||||||
{{ with .Page.Params.Tags }}{{ partial "taxonomy/tags.html" . }}{{ end }}
|
{{ with .Page.Params.Tags }}{{ partial "taxonomy/tags.html" . }}{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user