Add `author` param and display it

This commit is contained in:
BBaoVanC 2021-10-26 14:27:37 -05:00
parent d393d9eef9
commit 9e5a8e6785
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
4 changed files with 13 additions and 1 deletions

View File

@ -2,6 +2,7 @@
title: {{ replace .Name "-" " " | title }}
date: {{ .Date | time.Format "2006-01-02" }}
author: {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
toc: true
comments: true
draft: true

View File

@ -1,6 +1,7 @@
---
title: {{ replace .Name "-" " " | title }}
author: {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
menu: main
toc: true
comments: false

View File

@ -1,12 +1,15 @@
baseURL = "https://example.com"
theme = "bobatheme"
defaultContentLanguage = "en"
author = "bbaovanc"
copyright = '&copy; 2021 bbaovanc <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>'
sectionPagesMenu = "main"
enableRobotsTXT = true
paginate = 5
enableGitInfo = true
[author]
name = "bbaovanc"
[markup]
[markup.highlight]
noClasses = false

View File

@ -20,6 +20,13 @@
{{ end }}
{{ end }}
{{ with .Params.author }}
<span class="post-meta-item">
{{ partial "icon.html" "user" }}
{{ . }}
</span>
{{ end }}
{{ if .IsTranslated }}
<span class="post-meta-item">
{{ partial "icon.html" "globe" }}