Update author method and IsMultilingual method

This commit is contained in:
Lou Chang 2024-06-29 02:17:10 -04:00
parent e9e89a4613
commit afed7a6cc4
9 changed files with 20 additions and 20 deletions

View file

@ -24,8 +24,8 @@
{{- /* Meta */ -}}
<div class="post-meta">
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
{{- $author := $params.author | default .Site.Params.author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Params.author.link | default .Site.Home.RelPermalink -}}
<span class="post-author">
{{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}}
{{- partial "plugin/a.html" $options -}}

View file

@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}

View file

@ -32,7 +32,7 @@
{{- /* Author */ -}}
{{- if ne .Site.Params.footer.author false -}}
<span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Author.name }}</a></span>
<span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Params.author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Params.author.name }}</a></span>
{{- end -}}
{{- /* License */ -}}

View file

@ -26,7 +26,7 @@
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
{{- with .Site.Author.name -}}
{{- with .Site.Params.author.name -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
@ -122,7 +122,7 @@
{{- with .Site.Copyright -}}
"license": {{ . | safeHTML }},
{{- end -}}
{{- $publisher := .Params.author | default .Site.Author.name | default (T "author") | dict "name" -}}
{{- $publisher := .Params.author | default .Site.Params.author.name | default (T "author") | dict "name" -}}
{{- $publisher = $params.seo.publisher | default dict | merge $publisher -}}
"publisher": {
"@type": "Organization",
@ -141,7 +141,7 @@
{{- end -}}
{{- end -}}
},
{{- with .Params.author | default .Site.Author.name | default (T "author") -}}
{{- with .Params.author | default .Site.Params.author.name | default (T "author") -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}

View file

@ -57,7 +57,7 @@
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
</a>
{{- if .Site.IsMultiLingual -}}
{{- if hugo.IsMultilingual -}}
<a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}">
<i class="fa fa-globe" aria-hidden="true"></i>
<select class="language-select" id="language-select-desktop" onchange="location = this.value;">
@ -149,7 +149,7 @@
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
</a>
{{- if .Site.IsMultiLingual -}}
{{- if hugo.IsMultilingual -}}
<a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
<i class="fa fa-globe fa-fw" aria-hidden="true"></i>

View file

@ -1,4 +1,4 @@
{{- $params := .Page.Params | merge .Site.Params.Page | merge (dict "author" .Site.Author.name) -}}
{{- $params := .Page.Params | merge .Site.Params.Page | merge (dict "author" .Site.Params.author.name) -}}
<item>
<title>
{{- .Page.Title -}}

View file

@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}

View file

@ -30,8 +30,8 @@
{{- /* Meta */ -}}
<div class="post-meta">
<div class="post-meta-line">
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
{{- $author := $params.author | default .Site.Params.author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Params.author.link | default .Site.Home.RelPermalink -}}
<span class="post-author">
{{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}}
{{- partial "plugin/a.html" $options -}}

View file

@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}