From ca3bce8d6d36017acbd4c3a513f24c46ed27f600 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 9 May 2025 09:09:20 +0800 Subject: feat: add author information --- hugo.yaml | 1 + layouts/partials/head/siteinfo.html | 12 ++++++------ layouts/partials/header.html | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hugo.yaml b/hugo.yaml index 048be5a4..82fc67eb 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -82,6 +82,7 @@ markup: tabWidth: 2 params: + author: Eltrac mainSections: - posts - fictions diff --git a/layouts/partials/head/siteinfo.html b/layouts/partials/head/siteinfo.html index 64c14506..ff029ac1 100644 --- a/layouts/partials/head/siteinfo.html +++ b/layouts/partials/head/siteinfo.html @@ -7,7 +7,7 @@ {{ $title }} - + @@ -39,11 +39,11 @@ "description" : "{{ default .Summary .Description | plainify }}", {{- end }} "inLanguage" : "zh-CN", - "author" : "{{ .Site.Author.name }}", - "creator" : "{{ .Site.Author.name }}", - "publisher": "{{ .Site.Author.name }}", - "accountablePerson" : "{{ .Site.Author.name }}", - "copyrightHolder" : "{{ .Site.Author.name }}", + "author" : "{{ .Params.author | default .Site.Params.author }}", + "creator" : "{{ .Params.author | default .Site.Params.author }}", + "publisher": "{{ .Params.author | default .Site.Params.author }}", + "accountablePerson" : "{{ .Params.author | default .Site.Params.author }}", + "copyrightHolder" : "{{ .Params.author | default .Site.Params.author }}", "copyrightYear" : "{{ .Date.Format "2006" }}", "datePublished": "{{ .Date }}", "dateModified" : "{{ .Date }}", diff --git a/layouts/partials/header.html b/layouts/partials/header.html index bf2716dd..9f6d4f78 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,7 +6,7 @@ style="view-transition-name: title-image" /> {{ or .Site.Params.headTitle .Site.Author.name }}{{ .Site.Params.headTitle }} -- cgit v1.2.3