From 957adc43f707a9fc3cedfa389d2643cb50aee351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=BCller?= Date: Fri, 4 Jun 2021 16:45:54 +0200 Subject: [PATCH 1/4] make image quality configurable for post headers --- layouts/posts/single.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layouts/posts/single.html b/layouts/posts/single.html index e6470edcb..024dd3f27 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -80,6 +80,7 @@
{{ end }} + {{- $imageQuality := $params.ImageQuality | default "90" -}}
{{ if eq $pageTheme "hero" }} @@ -87,7 +88,7 @@ {{- $heroImage := "" -}} {{- with .Resources.GetMatch "featured-image" -}} {{- if lt 2000 .Width -}} - {{- $heroImage = (.Resize "2000x q100").Permalink -}} + {{- $heroImage = (.Resize (print "2000x q" $imageQuality)).Permalink -}} {{- else -}} {{- $heroImage = .Permalink -}} {{- end -}} @@ -158,7 +159,7 @@

{{ $.Title }}

{{- if eq $pageTheme "full" -}} {{- with $.Resources.GetMatch "featured-image" -}} {{- if lt 2000 .Width -}} - {{- $fullImage = (.Resize "2000x q100").Permalink -}} + {{- $fullImage = (.Resize (print "2000x q" $imageQuality)).Permalink -}} {{- else -}} {{- $fullImage = .Permalink -}} {{- end -}} From cd22ea33d816fd5492dde16db2f940bf7936602b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=BCller?= Date: Sat, 5 Jun 2021 12:05:19 +0200 Subject: [PATCH 2/4] add support for plausible analytics --- layouts/partials/plugin/analytics.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/layouts/partials/plugin/analytics.html b/layouts/partials/plugin/analytics.html index f1444168b..35d8bb83d 100644 --- a/layouts/partials/plugin/analytics.html +++ b/layouts/partials/plugin/analytics.html @@ -49,4 +49,9 @@ {{- end -}} + + {{- /* Plausible Analytics */ -}} + {{- if $analytics.plausible.domain -}} + + {{- end -}} {{- end -}} From e609750a8711200fac4bc5e0a2fed28b068900fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=BCller?= Date: Tue, 15 Jun 2021 17:19:33 +0200 Subject: [PATCH 3/4] make plausible script configurable --- layouts/partials/plugin/analytics.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/partials/plugin/analytics.html b/layouts/partials/plugin/analytics.html index 35d8bb83d..6ce802c79 100644 --- a/layouts/partials/plugin/analytics.html +++ b/layouts/partials/plugin/analytics.html @@ -52,6 +52,7 @@ {{- /* Plausible Analytics */ -}} {{- if $analytics.plausible.domain -}} - + {{ $plausibleScript := $analytics.plausible.script | default "https://plausible.io/js/plausible.js" }} + {{- end -}} {{- end -}} From 484ee3cb3b54c9362ce767a539c3d55370508e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=BCller?= Date: Fri, 16 Jul 2021 10:23:23 +0200 Subject: [PATCH 4/4] lower quality of twitter large summary preview image --- layouts/posts/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 024dd3f27..f0ae9bbe5 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -19,7 +19,7 @@ {{ $twitterImage := ""}} {{- with .Resources.GetMatch "featured-image" -}} {{- if lt 4095 .Width -}} -{{- $twitterImage = (.Resize "4095x q100").Permalink -}} +{{- $twitterImage = (.Resize "4095x q70").Permalink -}} {{- else -}} {{- $twitterImage = .Permalink -}} {{- end -}}