Remove trim blank charsets flag to improve speed.

This commit is contained in:
凡梦星尘
2023-01-01 21:12:58 +08:00
parent d0a6d943e0
commit a2f37c8470
55 changed files with 494 additions and 496 deletions

View File

@@ -1,4 +1,4 @@
{{- if .Site.Params.creativeCommons.post }}
{{ if .Site.Params.creativeCommons.post }}
<div class="post-copyright">
<img src="/imgs/cc/cc.svg" width="75" height="75" align="right" alt="{{ T "CCLinkTitle" }}"/>
<ul>
@@ -7,29 +7,29 @@
{{ .Title }}
</li>
<li class="post-copyright-author">
{{- if isset .Params "author" }}
{{ if isset .Params "author" }}
<strong>{{ print (T "PostCROriginAuthor") (T "SymbolColon") }} </strong>
{{ .Params.Author }}
{{- else }}
{{ else }}
<strong>{{ print (T "PostCRAuthor") (T "SymbolColon") }} </strong>
{{ .Site.Params.author }}
{{- end }}
{{ end }}
</li>
<li class="post-copyright-link">
{{- if isset .Params "link" }}
{{ if isset .Params "link" }}
<strong>{{ print (T "PostCROriginLink") (T "SymbolColon") }} </strong>
<a target="_blank" href="{{ .Params.OriginLink }}" title="{{ .Title }}">{{ .Params.Link }}</a>
{{- else }}
{{ else }}
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }}</strong>
<a id="post-cr-link" href="{{ .Permalink | absLangURL }}" title="{{ .Title }}">{{ .Permalink | absLangURL }}</a>
{{- end }}
{{ end }}
</li>
<li class="post-copyright-license">
<strong>{{ print (T "PostCRLicenseTitle") (T "SymbolColon") }} </strong>
{{- $ccText := .Site.Params.creativeCommons.license | upper }}
{{- $ccLink := printf "<a target='_blank' href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.%s'>%s</a>" (substr .Site.LanguageCode 0 2) $ccText }}
{{ $ccText := .Site.Params.creativeCommons.license | upper }}
{{ $ccLink := printf "<a target='_blank' href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.%s'>%s</a>" (substr .Site.LanguageCode 0 2) $ccText }}
{{ printf (T "PostCRLicenseContent") $ccLink | safeHTML }}
</li>
</ul>
</div>
{{- end }}
{{ end }}

View File

@@ -1,12 +1,12 @@
{{- with .Site.Params.followMe }}
{{ with .Site.Params.followMe }}
<div class="followme">
<span>{{ T "PostFollowMe" }}</span>
<div class="social-list">
{{ range . }}
{{- $vals := split . "||" }}
{{- $name := trim (index $vals 0) " " }}
{{- $url := trim (index $vals 1) " " }}
{{- $icon := trim (index $vals 2) " " }}
{{ $vals := split . "||" }}
{{ $name := trim (index $vals 0) " " }}
{{ $url := trim (index $vals 1) " " }}
{{ $icon := trim (index $vals 2) " " }}
<div class="social-item">
<a target="_blank" class="social-link" href="{{ $url }}">
<span class="icon">
@@ -15,7 +15,7 @@
<span class="label">{{ $name }}</span>
</a>
</div>
{{- end }}
{{ end }}
</div>
</div>
{{- end }}
{{ end }}

View File

@@ -1,21 +1,21 @@
{{- with .Site.Params.rewardSets }}
{{- if .enable }}
{{ with .Site.Params.rewardSets }}
{{ if .enable }}
<div class="reward-container">
<div>{{- .comment | safeHTML -}}</div>
<div>{{ .comment | safeHTML }}</div>
<button>
{{- T "RewardDonate" -}}
{{ T "RewardDonate" }}
</button>
<div class="post-reward">
{{- range $name,$img := .reward }}
{{- $fw := substr $name 0 1 }}
{{- $pay := replace $name $fw ($fw | upper) 1 }}
{{- $payName := T (printf "Reward%s" $pay) }}
{{ range $name,$img := .reward }}
{{ $fw := substr $name 0 1 }}
{{ $pay := replace $name $fw ($fw | upper) 1 }}
{{ $payName := T (printf "Reward%s" $pay) }}
<div class="post-reward-item">
<img src="/imgs/img-lazy-loading.gif" data-src="{{ $img }}" alt="{{ $.Site.Params.author }} - {{ $payName }}">
<span>{{ $payName }}</span>
</div>
{{- end }}
{{ end }}
</div>
</div>
{{- end }}
{{- end }}
{{ end }}
{{ end }}

View File

@@ -1,9 +1,9 @@
{{- with .Params.tags }}
{{ with .Params.tags }}
<div class="post-tags">
{{ range . }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize | lower }}">
{{ . }}
</a>
{{- end }}
{{ end }}
</div>
{{- end }}
{{ end }}