Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update author method and IsMultilingual method #875

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions layouts/_default/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ <h1 class="single-title" itemprop="name headline">

{{- /* 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 -}}
Expand Down
6 changes: 3 additions & 3 deletions layouts/index.rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ -}}
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/head/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
{{- with .Site.Author.name -}}
{{- with .Site.Params.author.name -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
Expand Down Expand Up @@ -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",
Expand All @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;">
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/rss/item.html
Original file line number Diff line number Diff line change
@@ -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 -}}
Expand Down
6 changes: 3 additions & 3 deletions layouts/posts/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ <h2 class="single-subtitle">{{ . }}</h2>
{{- /* 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 -}}
Expand Down
6 changes: 3 additions & 3 deletions layouts/taxonomy/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down