⚡ Remove trim blank charsets flag to improve speed.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
{{- if isset .Site.Params.analytics "laid" }}
|
||||
{{ if isset .Site.Params.analytics "laid" }}
|
||||
{{ partial "_thirdparty/analytics/51la.html" . }}
|
||||
{{- end }}
|
||||
{{- if isset .Site.Params.analytics "baidu" }}
|
||||
{{ end }}
|
||||
{{ if isset .Site.Params.analytics "baidu" }}
|
||||
{{ partial "_thirdparty/analytics/baidu.html" . }}
|
||||
{{- end }}
|
||||
{{- if isset .Site.Params.analytics "google" }}
|
||||
{{ end }}
|
||||
{{ if isset .Site.Params.analytics "google" }}
|
||||
{{ partial "_thirdparty/analytics/google.html" . }}
|
||||
{{- end }}
|
||||
{{- if isset .Site.Params.analytics "busuanzi" }}
|
||||
{{ end }}
|
||||
{{ if isset .Site.Params.analytics "busuanzi" }}
|
||||
{{ partial "_thirdparty/analytics/busuanzi.html" . }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
@@ -1,11 +1,11 @@
|
||||
{{- $pageCfg := dict
|
||||
{{ $pageCfg := dict
|
||||
"isHome" .IsHome
|
||||
"isPage" .IsPage
|
||||
"comments" (.Scratch.Get "isComment")
|
||||
"permalink" (.Page.Permalink | absURL)
|
||||
"path" (.Page.Permalink | path.Base)
|
||||
"title" .Page.Title
|
||||
-}}
|
||||
}}
|
||||
|
||||
{{/* Append waline pageview & comment plugin */}}
|
||||
{{ if and .Site.Params.waline ( or .Site.Params.waline.pageView .Site.Params.waline.comment) }}
|
||||
@@ -37,4 +37,4 @@
|
||||
{{ $pageCfg = merge $pageCfg (dict "math" $math) }}
|
||||
{{ end }}
|
||||
|
||||
<script class="next-config" data-name="page" type="application/json">{{- $pageCfg -}}</script>
|
||||
<script class="next-config" data-name="page" type="application/json">{{ $pageCfg }}</script>
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- with .Site.Params.openGraph.facebook }}
|
||||
{{- range $attr, $val := . }}
|
||||
{{ with .Site.Params.openGraph.facebook }}
|
||||
{{ range $attr, $val := . }}
|
||||
<meta property="fb:{{ $attr }}" content="{{ $val }}">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -1,9 +1,9 @@
|
||||
<!-- Website icons -->
|
||||
{{- with .Site.Params.favicon }}
|
||||
{{ with .Site.Params.favicon }}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ .icon }}">
|
||||
<link rel="icon" type="image/x-icon" href="{{ .icon }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ .small }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ .medium }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ .appleTouchIcon }}">
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
<!-- Website icons -->
|
||||
@@ -1,3 +1,3 @@
|
||||
{{- with .Site.Params.openGraph.googlePlus }}
|
||||
{{ with .Site.Params.openGraph.googlePlus }}
|
||||
<link rel="publisher" href=" {{ . }}">
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
@@ -1,10 +1,10 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
{{- if .Site.Params.darkmode }}
|
||||
{{ if .Site.Params.darkmode }}
|
||||
<meta name="theme-color" content="{{ .Site.Params.themeColor.dark }}" media="(prefers-color-scheme: dark)" />
|
||||
{{- else }}
|
||||
{{ else }}
|
||||
<meta name="theme-color" content="{{ .Site.Params.themeColor.light }}" media="(prefers-color-scheme: light)" />
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ hugo.Generator }}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}">
|
||||
<link rel="icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}">
|
||||
@@ -13,18 +13,18 @@
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon.appleTouchIcon }}">
|
||||
<meta itemprop="name" content="{{ .Title }}" />
|
||||
<meta itemprop="description" content="{{ .Description | default .Site.Params.description }}" />
|
||||
{{- if .IsPage }}
|
||||
{{- with .Date }}
|
||||
{{ if .IsPage }}
|
||||
{{ with .Date }}
|
||||
<meta itemprop="datePublished" {{ . }} />
|
||||
{{- end }}
|
||||
{{- with .Lastmod }}
|
||||
{{ end }}
|
||||
{{ with .Lastmod }}
|
||||
<meta itemprop="dateModified" {{ . }} />
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $img := .Site.Params.customLogo | default .Site.Params.avatar.url }}
|
||||
{{- if and .IsPage (isset .Params "images") }}
|
||||
{{- $img := index .Params.images 0 }}
|
||||
{{- end }}
|
||||
{{- .Scratch.Set "metaImg" $img }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $img := .Site.Params.customLogo | default .Site.Params.avatar.url }}
|
||||
{{ if and .IsPage (isset .Params "images") }}
|
||||
{{ $img := index .Params.images 0 }}
|
||||
{{ end }}
|
||||
{{ .Scratch.Set "metaImg" $img }}
|
||||
<meta itemprop="image" content="{{ $img | absURL }}" />
|
||||
<meta itemprop="keywords" content="{{ if and .IsPage (isset .Params "tags")}}{{ delimit .Params.tags "," }}{{ else }}{{ .Site.Params.keywords }}{{ end }}" />
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{- $Site := .Site -}}
|
||||
{{- $Params := .Site.Params -}}
|
||||
{{- $Page := .Page -}}
|
||||
{{- $langCode := .Scratch.Get "langCode" -}}
|
||||
{{- with .Site.Params.openGraph -}}
|
||||
{{- if .enable -}}
|
||||
{{ $Site := .Site }}
|
||||
{{ $Params := .Site.Params }}
|
||||
{{ $Page := .Page }}
|
||||
{{ $langCode := .Scratch.Get "langCode" }}
|
||||
{{ with .Site.Params.openGraph }}
|
||||
{{ if .enable }}
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="{{ $Page.Title }}">
|
||||
<meta property="og:description" content="{{ default $Params.description $Page.Description }}">
|
||||
@@ -12,21 +12,21 @@
|
||||
<meta property="og:site_name" content="{{ $Site.Title }}">
|
||||
<meta property="og:locale" content="{{ $langCode }}">
|
||||
<meta property="article:author" content="{{ default $Params.author $Page.Params.Author }}">
|
||||
{{- with .twitter -}}
|
||||
{{- range $attr, $val := . }}
|
||||
{{ with .twitter }}
|
||||
{{ range $attr, $val := . }}
|
||||
<meta name="twitter:{{ $attr }}" content="{{ $val }}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{- with .googlePlus }}
|
||||
{{ with .googlePlus }}
|
||||
<link rel="publisher" href=" {{ . }}">
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
{{- with .facebook -}}
|
||||
{{- range $attr, $val := . }}
|
||||
{{ with .facebook }}
|
||||
{{ range $attr, $val := . }}
|
||||
<meta property="fb:{{ $attr }}" content="{{ $val }}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if .Site.Params.openGraph.enable }}
|
||||
{{ if .Site.Params.openGraph.enable }}
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||
<meta property="og:title" content="{{ .Title | default .Site.Title }}" />
|
||||
<meta property="og:description" content="{{ .Description | default .Site.Params.Description }}" />
|
||||
@@ -9,9 +9,9 @@
|
||||
<meta property="og:url" content="{{ .Permalink }}"/>
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}" />
|
||||
<meta property="og:locale" content="{{ .Site.LanguageCode }}"/>
|
||||
{{- if .IsPage }}
|
||||
{{ if .IsPage }}
|
||||
<meta property="article:author" content="{{ .Params.Author | default .Site.Params.Author }}" />
|
||||
<meta property="article:published_time" content="{{ .Date }}" />
|
||||
<meta property="article:modified_time" content="{{ .Lastmod }}" />
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<!-- Plugin style files -->
|
||||
{{- $cssRes := .Site.Data.resources.css }}
|
||||
{{- $vendor := .Site.Params.vendors.plugins }}
|
||||
{{- $router := .Scratch.Get "router" }}
|
||||
{{ $cssRes := .Site.Data.resources.css }}
|
||||
{{ $vendor := .Site.Params.vendors.plugins }}
|
||||
{{ $router := .Scratch.Get "router" }}
|
||||
|
||||
{{- range $css := $cssRes }}
|
||||
{{ range $css := $cssRes }}
|
||||
{{ $pluginCss := partial "_funs/get_res.html" (dict "res" . "vendor" $vendor "router" $router) }}
|
||||
<link type="text/css" rel="stylesheet" href="{{ $pluginCss }}" />
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Main Style file -->
|
||||
{{- $scss := resources.Get "css/main.scss" }}
|
||||
{{- $scss = $scss | resources.ExecuteAsTemplate "main.scss" . }}
|
||||
{{- $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }}
|
||||
{{- if hugo.IsProduction }}
|
||||
{{- $css = $css | minify | fingerprint }}
|
||||
{{- end }}
|
||||
{{ $scss := resources.Get "css/main.scss" }}
|
||||
{{ $scss = $scss | resources.ExecuteAsTemplate "main.scss" . }}
|
||||
{{ $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $css = $css | minify | fingerprint }}
|
||||
{{ end }}
|
||||
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
||||
{{- if .IsPage }}
|
||||
{{ if .IsPage }}
|
||||
<style type="text/css">
|
||||
.post-footer, .flinks-list-footer hr:after {
|
||||
content: "{{ .Site.Params.postFooter.endLineTip }}";
|
||||
}
|
||||
</style>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
||||
{{- $custom := .Scratch.Get "style" }}
|
||||
{{- if $custom }}
|
||||
{{ $custom := .Scratch.Get "style" }}
|
||||
{{ if $custom }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $custom }}">
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- with .Site.Params.openGraph.twitter }}
|
||||
{{- $img := $.Params.openGraph.twitter.image | default ($.Scratch.Get "metaImg") }}
|
||||
{{ with .Site.Params.openGraph.twitter }}
|
||||
{{ $img := $.Params.openGraph.twitter.image | default ($.Scratch.Get "metaImg") }}
|
||||
<meta name="twitter:card" content="summary_large_image"/>
|
||||
<meta name="twitter:creator" content="{{ .creator }}"/>
|
||||
<meta name="twitter:description" content="{{ with $.Page.Description }}{{ . }}{{ else }}{{if $.Page.IsPage}}{{ .Summary }}{{ else }}{{ $.Params.description }}{{ end }}{{ end }}"/>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{{ if .IsHome }}
|
||||
{{- with .Site.Params.googleSiteVerification }}
|
||||
{{ with .Site.Params.googleSiteVerification }}
|
||||
<meta name="google-site-verification" content="{{ . }}">
|
||||
{{- end }}
|
||||
{{- with .Site.Params.bingSiteVerification }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.bingSiteVerification }}
|
||||
<meta name="msvalidate.01" content="{{ . }}">
|
||||
{{- end }}
|
||||
{{- with .Site.Params.yandexSiteVerification }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.yandexSiteVerification }}
|
||||
<meta name="yandex-verification" content="{{ . }}">
|
||||
{{- end }}
|
||||
{{- with .Site.Params.baiduSiteVerification }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.baiduSiteVerification }}
|
||||
<meta name="baidu-site-verification" content="{{ . }}">
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user