fix(format): string format error (#366)

This commit is contained in:
Dillon 2020-05-16 00:46:51 +08:00 committed by GitHub
parent 8a2bb03e5f
commit acef6c143e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 11 deletions

View file

@ -1,12 +1,12 @@
{{- define "title" }} {{- define "title" }}
{{- .Params.Title | default (T .Section) | default .Section | printf (T "allSome") }} - {{ .Site.Title -}} {{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) }} - {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{- define "content" -}} {{- define "content" -}}
<div class="page archive"> <div class="page archive">
{{- /* Title */ -}} {{- /* Title */ -}}
<h2 class="single-title animated pulse faster"> <h2 class="single-title animated pulse faster">
{{- .Params.Title | default (T .Section) | default .Section | printf (T "allSome") -}} {{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) -}}
</h2> </h2>
{{- /* Paginate */ -}} {{- /* Paginate */ -}}

View file

@ -12,7 +12,7 @@
{{- if ne .Site.Params.footer.hugo false -}} {{- if ne .Site.Params.footer.hugo false -}}
<div class="footer-line"> <div class="footer-line">
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %s">Hugo</a>` hugo.Version -}} {{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %s">Hugo</a>` hugo.Version -}}
{{- printf (T "poweredBySome") $hugo | safeHTML }} | {{ T "theme" }} - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt {{ .Scratch.Get `version` }}"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a> {{- $hugo | string | printf (T "poweredBySome" | string) | safeHTML }} | {{ T "theme" }} - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt {{ .Scratch.Get `version` }}"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a>
</div> </div>
{{- end -}} {{- end -}}

View file

@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "0.2.8" -}} {{- .Scratch.Set "version" "0.2.9" -}}
{{- /* LoveIt theme version detection */ -}} {{- /* LoveIt theme version detection */ -}}
{{- $VERSION := "0.2.X" -}} {{- $VERSION := "0.2.X" -}}

View file

@ -6,7 +6,7 @@
<div class="post-info-line"> <div class="post-info-line">
<div class="post-info-mod"> <div class="post-info-mod">
<span> <span>
{{- printf (T "lastMod") $modify_date -}} {{- $modify_date | string | printf (T "lastMod" | string) -}}
{{- if .Site.Params.gitRepo -}} {{- if .Site.Params.gitRepo -}}
{{- with .GitInfo -}} {{- with .GitInfo -}}
&nbsp;<a class="git-hash" href="{{ printf `%s/commit/%s` $.Site.Params.gitRepo .Hash }}" target="_blank" title="commit by {{ .AuthorName }}({{ .AuthorEmail }}) {{ .Hash }}: {{ .Subject }}"> &nbsp;<a class="git-hash" href="{{ printf `%s/commit/%s` $.Site.Params.gitRepo .Hash }}" target="_blank" title="commit by {{ .AuthorName }}({{ .AuthorEmail }}) {{ .Hash }}: {{ .Subject }}">
@ -17,9 +17,9 @@
</span> </span>
</div> </div>
<div class="post-info-license"> <div class="post-info-license">
{{- with $params.license -}} {{- with $params.license | string -}}
<span> <span>
{{- printf (T "license") . | safeHTML -}} {{- printf (T "license" | string) . | safeHTML -}}
</span> </span>
{{- end -}} {{- end -}}
</div> </div>

View file

@ -1,13 +1,13 @@
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel> <channel>
<title> <title>
{{- .Params.Title | default (T .Section) | default .Section | printf (T "allSome") }} - {{ .Site.Title -}} {{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) }} - {{ .Site.Title -}}
</title> </title>
<link> <link>
{{- .Permalink -}} {{- .Permalink -}}
</link> </link>
<description> <description>
{{- .Params.Title | default (T .Section) | default .Section | printf (T "allSome") }} | {{ .Site.Title -}} {{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) }} | {{ .Site.Title -}}
</description> </description>
<generator>Hugo -- gohugo.io</generator> <generator>Hugo -- gohugo.io</generator>
{{- with .Site.LanguageCode -}} {{- with .Site.LanguageCode -}}

View file

@ -1,5 +1,5 @@
{{- define "title" -}} {{- define "title" -}}
{{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | printf (T "allSome") }} - {{ .Site.Title -}} {{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | string | printf (T "allSome" | string) }} - {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{- define "content" -}} {{- define "content" -}}
@ -10,7 +10,7 @@
<div class="page archive"> <div class="page archive">
{{- /* Title */ -}} {{- /* Title */ -}}
<h2 class="single-title animated pulse faster"> <h2 class="single-title animated pulse faster">
{{- .Params.Title | default (T $taxonomies) | default $taxonomies | printf (T "allSome") -}} {{- .Params.Title | default (T $taxonomies) | default $taxonomies | string | printf (T "allSome" | string) -}}
</h2> </h2>
{{- /* Categories Page */ -}} {{- /* Categories Page */ -}}