⚡ Remove trim blank charsets flag to improve speed.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
{{ with .ctx }}
|
||||
{{- if $.IsHome }}
|
||||
{{- if .Params.Expand }}
|
||||
{{ if $.IsHome }}
|
||||
{{ if .Params.Expand }}
|
||||
{{ .Content }}
|
||||
{{- else }}
|
||||
{{ else }}
|
||||
{{ .Summary }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ .Content }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -1,44 +1,44 @@
|
||||
{{ with .ctx }}
|
||||
{{- if $.IsHome }}
|
||||
{{- if and .Site.Params.readMoreBtn (not .Params.Expand) }}
|
||||
{{ if $.IsHome }}
|
||||
{{ if and .Site.Params.readMoreBtn (not .Params.Expand) }}
|
||||
<div class="post-button">
|
||||
<a class="btn" href="{{ .RelPermalink | relLangURL }}#more" rel="contents">
|
||||
{{ T "PostReadMore" }} »
|
||||
</a>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
<div class="post-eof"></div>
|
||||
{{- else }}
|
||||
{{ else }}
|
||||
{{ partial "post/footer_meta/tags.html" . }}
|
||||
{{- if and (not (isset .Params "share")) (not .Params.share) }}
|
||||
{{ if and (not (isset .Params "share")) (not .Params.share) }}
|
||||
{{ partial "_thirdparty/share/addthis.html" . }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
<hr/>
|
||||
{{ partial "post/footer_meta/reward.html" . }}
|
||||
{{- if and (not (isset .Params "copyright")) (not .Params.copyright) }}
|
||||
{{ if and (not (isset .Params "copyright")) (not .Params.copyright) }}
|
||||
{{ partial "post/footer_meta/copyright.html" . }}
|
||||
{{- end }}
|
||||
{{- if and (not (isset .Params "followme")) (not .Params.followme) }}
|
||||
{{ end }}
|
||||
{{ if and (not (isset .Params "followme")) (not .Params.followme) }}
|
||||
{{ partial "post/footer_meta/followme.html" . }}
|
||||
{{- end }}
|
||||
{{- if and (not (isset .Params "nav")) (not .Params.nav) }}
|
||||
{{ end }}
|
||||
{{ if and (not (isset .Params "nav")) (not .Params.nav) }}
|
||||
<div class="post-nav">
|
||||
<div class="post-nav-next post-nav-item">
|
||||
{{- with .NextInSection }}
|
||||
{{ with .NextInSection }}
|
||||
<a href="{{ .RelPermalink | relLangURL }}" rel="next" title="{{ .Title }}">
|
||||
<i class="fa fa-chevron-left"></i> {{ .Title }}
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="post-nav-prev post-nav-item">
|
||||
{{- with .PrevInSection }}
|
||||
{{ with .PrevInSection }}
|
||||
<a href="{{ .RelPermalink | relLangURL }}" rel="prev" title="{{ .Title }}">
|
||||
{{ .Title }}
|
||||
<i class="fa fa-chevron-right"></i>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -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 }}
|
||||
@@ -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 }}
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
@@ -1,27 +1,27 @@
|
||||
{{ with .ctx }}
|
||||
{{- if $.IsHome }} <h2 {{ else }} <h1 {{ end -}} class="post-title" itemprop="name headline">
|
||||
{{- if and .Weight (gt .Weight 0) }}
|
||||
{{ if $.IsHome }} <h2 {{ else }} <h1 {{ end }} class="post-title" itemprop="name headline">
|
||||
{{ if and .Weight (gt .Weight 0) }}
|
||||
<span class="post-sticky-flag" title="{{ T "PostStickyTitle" }}">
|
||||
<i class="fa fa-thumbtack"></i>
|
||||
</span>
|
||||
{{- end }}
|
||||
{{- if $.IsHome }}
|
||||
{{- if and (isset .Params "extlink") (ne .Params.Extlink "") }}
|
||||
{{ end }}
|
||||
{{ if $.IsHome }}
|
||||
{{ if and (isset .Params "extlink") (ne .Params.Extlink "") }}
|
||||
<a href="{{ .Params.Extlink }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external">
|
||||
{{ .Title }}
|
||||
<i class="fa fa-external-link-alt"></i>
|
||||
</a>
|
||||
{{- else }}
|
||||
{{ else }}
|
||||
<a href="{{ .RelPermalink | relLangURL }}" itemprop="url" class="post-title-link">{{ .Title }}</a>
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- .Title }}
|
||||
{{- if .Site.Params.postEdit.enable }}
|
||||
{{- $editURL := printf "%s%s" .Site.Params.postEdit.url (path.Clean .File.Path) }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ .Title }}
|
||||
{{ if .Site.Params.postEdit.enable }}
|
||||
{{ $editURL := printf "%s%s" .Site.Params.postEdit.url (path.Clean .File.Path) }}
|
||||
<a href="{{ $editURL }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-edit-link" title="{{ T "PostEditTitle" }}"><i class="fa fa-pen-nib"></i></a>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $.IsHome }} </h2> {{ else }} </h1> {{ end -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $.IsHome }} </h2> {{ else }} </h1> {{ end }}
|
||||
{{ $isComment := and (.Scratch.Get "isComment") .Site.Params.waline.comment }}
|
||||
<div class="post-meta-container">
|
||||
<div class="post-meta-items">
|
||||
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- if not $.IsHome }}
|
||||
{{ if not $.IsHome }}
|
||||
<div class="post-meta-items">
|
||||
{{ partial "post/header_meta/words.html" . }}
|
||||
{{ partial "post/header_meta/readtime.html" . }}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{{- if .Site.Params.postMeta.categories }}
|
||||
{{- with .Params.categories }}
|
||||
{{ if .Site.Params.postMeta.categories }}
|
||||
{{ with .Params.categories }}
|
||||
<span class="post-meta-item">
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="far fa-folder-open"></i>
|
||||
</span>
|
||||
<span class="post-meta-item-text">{{- print (T "PostCategory") (T "SymbolColon") -}}</span>
|
||||
{{- range (first 1 .) }}
|
||||
<span class="post-meta-item-text">{{ print (T "PostCategory") (T "SymbolColon") }}</span>
|
||||
{{ range (first 1 .) }}
|
||||
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
|
||||
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" itemprop="url" rel="index">
|
||||
<span itemprop="name">{{- . -}}</span>
|
||||
<span itemprop="name">{{ . }}</span>
|
||||
</a>
|
||||
</span>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -1,13 +1,13 @@
|
||||
{{- if .Site.Params.postMeta.created }}
|
||||
{{ if .Site.Params.postMeta.created }}
|
||||
{{ $timeF := .Site.Params.timeFormat }}
|
||||
{{ $createdTime := (.Date.Format $timeF) | default (.Date.Format $timeF) }}
|
||||
<span class="post-meta-item">
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="far fa-calendar"></i>
|
||||
</span>
|
||||
<span class="post-meta-item-text">{{- print (T "PostPublishDate") (T "SymbolColon") -}}</span>
|
||||
<span class="post-meta-item-text">{{ print (T "PostPublishDate") (T "SymbolColon") }}</span>
|
||||
<time title="{{ print (T "PostPublishDate") (T "SymbolColon") }}{{ .Date }}" itemprop="dateCreated datePublished" datetime="{{ .Date }}">
|
||||
{{- .Date.Format .Site.Params.dateFormat -}}
|
||||
{{ .Date.Format .Site.Params.dateFormat }}
|
||||
</time>
|
||||
</span>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
@@ -1,9 +1,9 @@
|
||||
{{- if .Site.Params.postMeta.readTime }}
|
||||
{{ if .Site.Params.postMeta.readTime }}
|
||||
<span class="post-meta-item" title="{{ T "PostReading" }}">
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="far fa-clock"></i>
|
||||
</span>
|
||||
<span class="post-meta-item-text">{{- print (T "PostReading") (T "SymbolColon") -}}≈</span>
|
||||
<span>{{- T "PostReadTime" . -}}</span>
|
||||
<span class="post-meta-item-text">{{ print (T "PostReading") (T "SymbolColon") }}≈</span>
|
||||
<span>{{ T "PostReadTime" . }}</span>
|
||||
</span>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{{- if and .Site.Params.postMeta.updated.enable .Site.Params.postMeta.updated.anotherDay }}
|
||||
{{- if and .Lastmod (gt .Lastmod .Date) }}
|
||||
{{ if and .Site.Params.postMeta.updated.enable .Site.Params.postMeta.updated.anotherDay }}
|
||||
{{ if and .Lastmod (gt .Lastmod .Date) }}
|
||||
{{ $modTime := .Lastmod.Format .Site.Params.timeFormat }}
|
||||
<span class="post-meta-item">
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="far fa-calendar-check"></i>
|
||||
</span>
|
||||
<span class="post-meta-item-text">{{- print (T "PostLastModDate") (T "SymbolColon") -}}</span>
|
||||
<time title="{{ print (T "PostLastModTime") (T "SymbolColon") }}{{ $modTime }}" itemprop="dateModified" datetime="{{ $modTime }}">{{- .Lastmod.Format .Site.Params.dateFormat -}}</time>
|
||||
<span class="post-meta-item-text">{{ print (T "PostLastModDate") (T "SymbolColon") }}</span>
|
||||
<time title="{{ print (T "PostLastModTime") (T "SymbolColon") }}{{ $modTime }}" itemprop="dateModified" datetime="{{ $modTime }}">{{ .Lastmod.Format .Site.Params.dateFormat }}</time>
|
||||
</span>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -1,10 +1,10 @@
|
||||
{{- $pageViewId := "" }}
|
||||
{{- if .Site.Params.leancloudVisitors.enable }}
|
||||
{{- $pageViewId = "leancloud-visitors-count" }}
|
||||
{{- end }}
|
||||
{{- if .Site.Params.analytics.busuanzi.postViews }}
|
||||
{{- $pageViewId = "busuanzi_value_page_pv" }}
|
||||
{{- end }}
|
||||
{{ $pageViewId := "" }}
|
||||
{{ if .Site.Params.leancloudVisitors.enable }}
|
||||
{{ $pageViewId = "leancloud-visitors-count" }}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.analytics.busuanzi.postViews }}
|
||||
{{ $pageViewId = "busuanzi_value_page_pv" }}
|
||||
{{ end }}
|
||||
<span class="post-meta-item" title="{{ T "PostViews" }}">
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="far fa-eye"></i>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{{- if .Site.Params.postMeta.wordCount }}
|
||||
{{ if .Site.Params.postMeta.wordCount }}
|
||||
<span class="post-meta-item" title="{{ T "PostWords" }}">
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="far fa-file-word"></i>
|
||||
</span>
|
||||
<span class="post-meta-item-text">{{- print (T "PostWords") (T "SymbolColon") -}}</span><span>{{- T "PostWordCount" . -}}</span>
|
||||
<span class="post-meta-item-text">{{ print (T "PostWords") (T "SymbolColon") }}</span><span>{{ T "PostWordCount" . }}</span>
|
||||
</span>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user