Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Cai <github@jimmycai.com>2022-06-12 16:51:46 +0300
committerGitHub <noreply@github.com>2022-06-12 16:51:46 +0300
commit751d7d175326e20d23a6bac6b701f83cfd3a1715 (patch)
tree1be1b55acdd735aaa8cd507842bcf02753953bd9
parentde22945155e20230c06041ceb8329448765528cd (diff)
refactor: remove some usages of `default` in template
No longer needed thanks to Hugo's configuration merge
-rw-r--r--layouts/_default/_markup/render-image.html2
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/page/search.json2
-rw-r--r--layouts/partials/article-list/compact.html2
-rw-r--r--layouts/partials/article/components/header.html2
-rw-r--r--layouts/partials/head/colorScheme.html4
-rw-r--r--layouts/partials/head/opengraph/provider/twitter.html2
-rw-r--r--layouts/partials/sidebar/left.html4
8 files changed, 10 insertions, 10 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index 0ed5584..5577736 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -17,7 +17,7 @@
{{- $Height = $image.Height -}}
{{- $galleryImage = true -}}
- {{- if (default true .Page.Site.Params.imageProcessing.content.enabled) -}}
+ {{- if .Page.Site.Params.imageProcessing.content.enabled -}}
{{- $small := $image.Resize `480x` -}}
{{- $big := $image.Resize `1024x` -}}
{{- $Srcset = printf `%s 480w, %s 1024w` $small.RelPermalink $big.RelPermalink -}}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 9bc618d..4e1e0b5 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -25,7 +25,7 @@
{{- $Width := $image.resource.Width -}}
{{- $Height := $image.resource.Height -}}
- {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
+ {{- if .Page.Site.Params.imageProcessing.cover.enabled -}}
{{- $thumbnail := $image.resource.Fill "120x120" -}}
{{- $Permalink = $thumbnail.RelPermalink -}}
{{- $Width = $thumbnail.Width -}}
diff --git a/layouts/page/search.json b/layouts/page/search.json
index 67f4cc6..a0f5184 100644
--- a/layouts/page/search.json
+++ b/layouts/page/search.json
@@ -7,7 +7,7 @@
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}}
{{- if $image.exists -}}
{{- $imagePermalink := "" -}}
- {{- if and $image.resource (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
+ {{- if and $image.resource .Page.Site.Params.imageProcessing.cover.enabled -}}
{{- $thumbnail := $image.resource.Fill "120x120" -}}
{{- $imagePermalink = (absURL $thumbnail.Permalink) -}}
{{- else -}}
diff --git a/layouts/partials/article-list/compact.html b/layouts/partials/article-list/compact.html
index 376512a..edd58a0 100644
--- a/layouts/partials/article-list/compact.html
+++ b/layouts/partials/article-list/compact.html
@@ -19,7 +19,7 @@
{{- $Width := $image.resource.Width -}}
{{- $Height := $image.resource.Height -}}
- {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
+ {{- if .Page.Site.Params.imageProcessing.cover.enabled -}}
{{- $thumbnail := $image.resource.Fill "120x120" -}}
{{- $Permalink = $thumbnail.RelPermalink -}}
{{- $Width = $thumbnail.Width -}}
diff --git a/layouts/partials/article/components/header.html b/layouts/partials/article/components/header.html
index 7582ec2..78b41bd 100644
--- a/layouts/partials/article/components/header.html
+++ b/layouts/partials/article/components/header.html
@@ -9,7 +9,7 @@
{{- $Height := $image.resource.Height -}}
{{- $Srcset := "" -}}
- {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
+ {{- if .Page.Site.Params.imageProcessing.cover.enabled -}}
{{- $thumbnail := $image.resource.Resize "800x" -}}
{{- $thumbnailRetina := $image.resource.Resize "1600x" -}}
{{- $Srcset = printf "%s 800w, %s 1600w" $thumbnail.RelPermalink $thumbnailRetina.RelPermalink -}}
diff --git a/layouts/partials/head/colorScheme.html b/layouts/partials/head/colorScheme.html
index 42f4dd8..04d63a5 100644
--- a/layouts/partials/head/colorScheme.html
+++ b/layouts/partials/head/colorScheme.html
@@ -1,5 +1,5 @@
-{{- $defaultColorScheme := default "auto" .Site.Params.colorScheme.default -}}
-{{- if not (default false .Site.Params.colorScheme.toggle) -}}
+{{- $defaultColorScheme := .Site.Params.colorScheme.default -}}
+{{- if not .Site.Params.colorScheme.toggle -}}
{{/* If toggle is disabled, force default scheme */}}
<script>
(function() {
diff --git a/layouts/partials/head/opengraph/provider/twitter.html b/layouts/partials/head/opengraph/provider/twitter.html
index 03bbf22..a837ba3 100644
--- a/layouts/partials/head/opengraph/provider/twitter.html
+++ b/layouts/partials/head/opengraph/provider/twitter.html
@@ -11,6 +11,6 @@
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}}
{{- if $image.exists -}}
- <meta name="twitter:card" content="{{ default `summary_large_image` .Site.Params.opengraph.twitter.card }}">
+ <meta name="twitter:card" content="{{ .Site.Params.opengraph.twitter.card }}">
<meta name="twitter:image" content='{{ absURL $image.permalink }}' />
{{- end -}} \ No newline at end of file
diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html
index f255389..321e1a6 100644
--- a/layouts/partials/sidebar/left.html
+++ b/layouts/partials/sidebar/left.html
@@ -7,7 +7,7 @@
<header>
{{ with .Site.Params.sidebar.avatar }}
- {{ if (default true .enabled) }}
+ {{ if .enabled }}
<figure class="site-avatar">
<a href="{{ .Site.BaseURL | relLangURL }}">
{{ if not .local }}
@@ -88,7 +88,7 @@
</li>
{{ end }}
- {{ if (default false .Site.Params.colorScheme.toggle) }}
+ {{ if .Site.Params.colorScheme.toggle }}
<li id="dark-mode-toggle">
{{ partial "helper/icon" "toggle-left" }}
{{ partial "helper/icon" "toggle-right" }}