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 }} title: {{ replace .Name "-" " " | title }}
date: {{ .Date | time.Format "2006-01-02" }} date: {{ .Date | time.Format "2006-01-02" }}
author: {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
toc: true toc: true
comments: true comments: true
draft: true draft: true

View File

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

View File

@ -1,12 +1,15 @@
baseURL = "https://example.com" baseURL = "https://example.com"
theme = "bobatheme" theme = "bobatheme"
defaultContentLanguage = "en" 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" sectionPagesMenu = "main"
enableRobotsTXT = true enableRobotsTXT = true
paginate = 5 paginate = 5
enableGitInfo = true enableGitInfo = true
[author]
name = "bbaovanc"
[markup] [markup]
[markup.highlight] [markup.highlight]
noClasses = false noClasses = false

View File

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