Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exampleSite/config.toml5
-rw-r--r--exampleSite/content/blog/categories-post.md2
-rw-r--r--exampleSite/content/blog/creating-a-new-theme.md1
-rw-r--r--exampleSite/content/blog/linked-post.md2
-rw-r--r--layouts/_default/list.html4
-rw-r--r--layouts/_default/single.html4
-rw-r--r--layouts/partials/recent_posts.html4
7 files changed, 15 insertions, 7 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index c4fda7a..b7276db 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -199,3 +199,8 @@ paginate = 10
title = "From our blog"
subtitle = "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo."
hide_summary = false
+
+[taxonomies]
+ category = "categories"
+ tag = "tags"
+ author = "authors"
diff --git a/exampleSite/content/blog/categories-post.md b/exampleSite/content/blog/categories-post.md
index 01eb130..55f2b78 100644
--- a/exampleSite/content/blog/categories-post.md
+++ b/exampleSite/content/blog/categories-post.md
@@ -4,7 +4,7 @@ date = "2021-08-01T21:29:20+02:00"
tags = ["golang", "programming", "theme", "hugo"]
categories = ["programming","lorem","pseudo"]
banner = "img/banners/banner-4.jpg"
-author = "John Doe"
+authors = ["John Doe"]
+++
I'm a post with multiple categories in the frontmatter:
diff --git a/exampleSite/content/blog/creating-a-new-theme.md b/exampleSite/content/blog/creating-a-new-theme.md
index 799a813..233b293 100644
--- a/exampleSite/content/blog/creating-a-new-theme.md
+++ b/exampleSite/content/blog/creating-a-new-theme.md
@@ -5,6 +5,7 @@ tags = ["theme"]
categories = ["starting"]
description = "This tutorial will show you how to create a simple theme in Hugo. I assume that you are familiar with HTML, the bash command line, and that you are comfortable using Markdown to format content."
banner = "img/banners/banner-1.jpg"
+authors = ["Jane Doe"]
+++
## Introduction
diff --git a/exampleSite/content/blog/linked-post.md b/exampleSite/content/blog/linked-post.md
index f2793d1..6463eca 100644
--- a/exampleSite/content/blog/linked-post.md
+++ b/exampleSite/content/blog/linked-post.md
@@ -4,7 +4,7 @@ date = "2015-10-02T21:49:20+02:00"
tags = ["golang", "programming", "theme", "hugo"]
categories = ["programming"]
banner = "img/banners/banner-4.jpg"
-author = "John Doe"
+authors = ["John Doe","Jane Doe"]
+++
I'm a linked post in the menu. You can add other posts by adding the following line to the frontmatter:
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 1b80b75..ba95831 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -37,8 +37,8 @@
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<div class="clearfix">
<p class="author-category">
- {{ if isset .Params "author" }}
- {{ i18n "authorBy" }} <a href="#">{{ .Params.author }}</a>
+ {{ if isset .Params "authors" }}
+ {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }}
{{ end }}
{{ if isset .Params "categories" }}
{{ if gt (len .Params.categories) 0 }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 29f2dd0..a04e456 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -22,7 +22,9 @@
{{ if or .Params.author .Params.date }}
<p class="text-muted text-uppercase mb-small text-right">
- {{ if .Params.author }}{{ i18n "authorBy" }} <a href="#">{{ .Params.author }}</a>{{ end }}
+ {{ if isset .Params "authors" }}
+ {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }}
+ {{ end }}
{{ if and .Params.author .Params.date }} | {{ end }}
{{ if .Params.date }}{{ .Date.Format .Site.Params.date_format }}{{ end }}
</p>
diff --git a/layouts/partials/recent_posts.html b/layouts/partials/recent_posts.html
index f16b272..d60fb8c 100644
--- a/layouts/partials/recent_posts.html
+++ b/layouts/partials/recent_posts.html
@@ -38,8 +38,8 @@
<div class="content">
<h4><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
<p class="author-category">
- {{ with .Params.author }}
- {{ i18n "authorBy" }} <a href="#">{{ . }}</a>
+ {{ if isset .Params "authors" }}
+ {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }}
{{ end }}
{{ i18n "publishedOn" }} {{ .Date.Format .Site.Params.date_format }}
</p>