博文作者

博客模塊默認支持多作者。

站點配置

請確保已於 taxonomies 中追加了 authors,以啓用多作者功能。

hugo.toml

1[taxonomies]
2  authors = 'authors'

hugo.yaml

1taxonomies:
2  authors: authors

hugo.json

1{
2   "taxonomies": {
3      "authors": "authors"
4   }
5}

註明作者

然後於內容前言中註明作者。

1authors = ['HB', 'Hugo']
1authors:
2- HB
3- Hugo
1{
2   "authors": [
3      "HB",
4      "Hugo"
5   ]
6}

現在該頁面由 HBHugo 合著,將會於頁面中顯示。

Authors Parameters

詳細地介紹作者。

ParameterTypeDescription
titlestring作者名稱。
descriptionstring作者描述。
email_hashstring郵箱的 md5 哈希值,用於生成 Gravatar 頭像,也可以使用下面的 images
imagesarray第一張圖片將作爲頭像。
socialsobject另請參閱社交鏈接

Authors Example

HB 爲例。

content/authors/hb/_index.md
1description = 'Contributors of HB Framework code and documentation.'
2images = ['https://avatars.githubusercontent.com/u/127904984?s=200&v=4']
3title = 'HB Framework Authors'
4[socials]
5  _color = false
6  github = 'hbstack'
1description: Contributors of HB Framework code and documentation.
2images:
3- https://avatars.githubusercontent.com/u/127904984?s=200&v=4
4socials:
5  _color: false
6  github: hbstack
7title: HB Framework Authors
 1{
 2   "description": "Contributors of HB Framework code and documentation.",
 3   "images": [
 4      "https://avatars.githubusercontent.com/u/127904984?s=200\u0026v=4"
 5   ],
 6   "socials": {
 7      "_color": false,
 8      "github": "hbstack"
 9   },
10   "title": "HB Framework Authors"
11}

socials._color 設置爲 false 以禁用彩色圖標。

razonyang
2024年10月6日 星期日 2023年3月31日 星期五