feat: improve configuration (#245)

* feat: improve configuration

* fix: fix partials/footer.html error
This commit is contained in:
Dillon
2020-04-21 22:55:06 +08:00
committed by GitHub
parent 8a0e61085c
commit f14301c395
62 changed files with 1548 additions and 1669 deletions

View File

@@ -1,6 +1,5 @@
{{- $scratch := .Scratch.Get "scratch" -}}
{{- $CDN := $scratch.Get "CDN" -}}
{{- $fingerprint := $scratch.Get "fingerprint" -}}
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
<link rel="canonical" href="{{ .Permalink }}" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
@@ -23,7 +22,7 @@
{{- end -}}
{{- /* normalize.css */ -}}
{{- $source := $CDN.normalizeCSS | default "lib/normalize/normalize.min.css" -}}
{{- $source := $cdn.normalizeCSS | default "lib/normalize/normalize.min.css" -}}
{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
@@ -34,11 +33,11 @@
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- /* Font Awesome */ -}}
{{- $source := $CDN.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
{{- $source := $cdn.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- /* Animate.css */ -}}
{{- $source := $CDN.animateCSS | default "lib/animate/animate.min.css" -}}
{{- $source := $cdn.animateCSS | default "lib/animate/animate.min.css" -}}
{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}

View File

@@ -1,3 +1,5 @@
{{- $params := .Scratch.Get "params" -}}
{{- with .Site.Params.verification.google -}}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
@@ -33,10 +35,10 @@
{{- with .Site.Params.description -}}
"description": "{{ . | safeJS }}",
{{- end -}}
{{- with .Site.Params.image -}}
{{- with $params.seo.image -}}
"image": "{{ .url | absURL }}",
{{- end -}}
{{- with .Site.Params.logo -}}
{{- with $params.seo.logo -}}
"thumbnailUrl": "{{ .url | absURL }}",
{{- end -}}
{{- with .Site.Copyright -}}
@@ -58,12 +60,12 @@
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- if ge .Site.Params.image.width 696 -}}
{{- if ge $params.seo.image.width 696 -}}
"image": {
"@type": "ImageObject",
"url": "{{ .Site.Params.image.url | absURL }}",
"width": {{ .Site.Params.image.width }},
"height": {{ .Site.Params.image.height }}
"url": "{{ $params.seo.image.url | absURL }}",
"width": {{ $params.seo.image.width }},
"height": {{ $params.seo.image.height }}
},
{{- end -}}
"genre": "{{ .Type }}",
@@ -83,7 +85,7 @@
{{- with .Site.Copyright -}}
"license": "{{ . | safeJS }}",
{{- end -}}
{{- with .Site.Params.publisher -}}
{{- with $params.seo.publisher -}}
"publisher": {
"@type": "Organization",
"name": "{{ .name | safeJS }}",