CodeIT icon indicating copy to clipboard operation
CodeIT copied to clipboard

[FEATURE] Could NOT support multi author for one post

Open yanboyang713 opened this issue 3 years ago • 2 comments

Currently, I found each post only supports one author's name. This is works. For example:

---
title: "New post"
author: "Boyang Yan"
date: 2021-10-05T03:44:00+11:00
categories: ["Programming"]
draft: false
---

However, If one post has multi-author, it does NOT work. For example:

---
title: "New post"
author: ["Boyang Yan", "test"]
date: 2021-10-05T03:44:00+11:00
categories: ["Programming"]
draft: false
---

Error msg:

Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: posts/single.html:16:12: executing "posts/single.html" at <partial "head/seo.html" .>: error calling partial: "/home/runner/work/yanboyang713.github.io/yanboyang713.github.io/themes/CodeIT/layouts/partials/head/seo.html:147:31": execute of template failed: template: partials/head/seo.html:147:31: executing "partials/head/seo.html" at <safeHTML>: error calling safeHTML: unable to cast []string{"Boyang Yan", "test"} of type []string to string

yanboyang713 avatar Oct 04 '21 18:10 yanboyang713

Hello @yanboyang713.

Yes, I will add multi-author support. But there is another property (authorLink) to improve.

I thought to create something like this in FrontMatter:

[[authors]]
authorName = "Author1"
authorLink = "https://www.google.com"

[[authors]]
authorName = "Author2"
authorLink = "https://www.google.com"

But I don't think it's a good idea. I'm not familiar with the Org format, but I think it does not support complex object types.

I think we need to add something like this:

author: ["Author1", "Author2"]
authorLink: ["https://www.google.com", "https://www.google.com"]

Also, backward compatibility will need to maintain in order to support the single author.

Reference issues/PRs: #255, #153.

victor-pogor avatar Nov 01 '21 17:11 victor-pogor

Hello @victor-pogor

Good day to you and thanks for your reply.

ok, I will have a look authorLink, first time know this.

Have a nice day,

Boyang

yanboyang713 avatar Nov 05 '21 03:11 yanboyang713