Convert all images to webp when possible

This commit is contained in:
2021-11-08 17:15:15 +01:00
parent 16f049dd09
commit 99c0d62efe
77 changed files with 33 additions and 56 deletions

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Before

Width:  |  Height:  |  Size: 400 KiB

After

Width:  |  Height:  |  Size: 400 KiB

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Before

Width:  |  Height:  |  Size: 382 KiB

After

Width:  |  Height:  |  Size: 382 KiB

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before

Width:  |  Height:  |  Size: 512 KiB

After

Width:  |  Height:  |  Size: 512 KiB

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Before

Width:  |  Height:  |  Size: 572 KiB

After

Width:  |  Height:  |  Size: 572 KiB

Before

Width:  |  Height:  |  Size: 499 KiB

After

Width:  |  Height:  |  Size: 499 KiB

Before

Width:  |  Height:  |  Size: 523 KiB

After

Width:  |  Height:  |  Size: 523 KiB

Before

Width:  |  Height:  |  Size: 522 KiB

After

Width:  |  Height:  |  Size: 522 KiB

Before

Width:  |  Height:  |  Size: 568 KiB

After

Width:  |  Height:  |  Size: 568 KiB

Before

Width:  |  Height:  |  Size: 540 KiB

After

Width:  |  Height:  |  Size: 540 KiB

Before

Width:  |  Height:  |  Size: 532 KiB

After

Width:  |  Height:  |  Size: 532 KiB

Before

Width:  |  Height:  |  Size: 553 KiB

After

Width:  |  Height:  |  Size: 553 KiB

Before

Width:  |  Height:  |  Size: 628 KiB

After

Width:  |  Height:  |  Size: 628 KiB

Before

Width:  |  Height:  |  Size: 560 KiB

After

Width:  |  Height:  |  Size: 560 KiB

Before

Width:  |  Height:  |  Size: 536 KiB

After

Width:  |  Height:  |  Size: 536 KiB

Before

Width:  |  Height:  |  Size: 594 KiB

After

Width:  |  Height:  |  Size: 594 KiB

Before

Width:  |  Height:  |  Size: 636 KiB

After

Width:  |  Height:  |  Size: 636 KiB

Before

Width:  |  Height:  |  Size: 314 KiB

After

Width:  |  Height:  |  Size: 314 KiB

Before

Width:  |  Height:  |  Size: 516 KiB

After

Width:  |  Height:  |  Size: 516 KiB

Before

Width:  |  Height:  |  Size: 546 KiB

After

Width:  |  Height:  |  Size: 546 KiB

Before

Width:  |  Height:  |  Size: 579 KiB

After

Width:  |  Height:  |  Size: 579 KiB

Before

Width:  |  Height:  |  Size: 558 KiB

After

Width:  |  Height:  |  Size: 558 KiB

Before

Width:  |  Height:  |  Size: 552 KiB

After

Width:  |  Height:  |  Size: 552 KiB

Before

Width:  |  Height:  |  Size: 559 KiB

After

Width:  |  Height:  |  Size: 559 KiB

Before

Width:  |  Height:  |  Size: 499 KiB

After

Width:  |  Height:  |  Size: 499 KiB

Before

Width:  |  Height:  |  Size: 536 KiB

After

Width:  |  Height:  |  Size: 536 KiB

Before

Width:  |  Height:  |  Size: 564 KiB

After

Width:  |  Height:  |  Size: 564 KiB

Before

Width:  |  Height:  |  Size: 515 KiB

After

Width:  |  Height:  |  Size: 515 KiB

Before

Width:  |  Height:  |  Size: 314 KiB

After

Width:  |  Height:  |  Size: 314 KiB

Before

Width:  |  Height:  |  Size: 348 KiB

After

Width:  |  Height:  |  Size: 348 KiB

Before

Width:  |  Height:  |  Size: 309 KiB

After

Width:  |  Height:  |  Size: 309 KiB

Before

Width:  |  Height:  |  Size: 371 KiB

After

Width:  |  Height:  |  Size: 371 KiB

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 909 KiB

After

Width:  |  Height:  |  Size: 909 KiB

Before

Width:  |  Height:  |  Size: 889 KiB

After

Width:  |  Height:  |  Size: 889 KiB

Before

Width:  |  Height:  |  Size: 243 KiB

After

Width:  |  Height:  |  Size: 243 KiB

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 189 KiB

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 407 KiB

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 177 KiB

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 115 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 400 KiB

@@ -47,7 +47,7 @@ I see you are a person of many qualities. I must say I am impressed. One last th
[attachment.zip](/files/writeups/google-ctf/2021/beginners-quest/8/attachment.zip)
{{< figure class="small" src="/img/writeups/google-ctf/2021/beginners-quest/8/hideandseek.png" title="hideandseek.png" >}}
{{< figure class="small" src="/img/writeups/google-ctf/2021/beginners-quest/8/hideandseek.png" title="hideandseek.png" raw=true >}}
_Note: The image is supposed to look like half is missing._
+1 -9
View File
@@ -44,15 +44,7 @@
{{- if .Params.Cover }}
<figure class="post-cover">
{{- $img := imageConfig (printf "static/%s" .Params.Cover) }}
{{- if .Params.UseRelativeCover }}
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- else }}
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- end }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify)) }}
{{- if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
@@ -23,9 +23,9 @@
<hr />
{{- end }}
{{ with .Params.Cover }}
<img src="/{{ . }}" class="post-cover" />
{{ end }}
{{- with .Params.Cover }}
{{- partial "image.html" (dict "path" . "alt" "" "class" "post-cover") }}
{{- end }}
<div class="post-content">
{{ .Content }}
+1 -3
View File
@@ -2,9 +2,7 @@
<main role="main" style="">
<div>
{{- if .Site.Params.Portrait.Path }}
{{- $img := imageConfig (printf "static/%s" .Site.Params.Portrait.Path) }}
<img src="{{ .Site.Params.Portrait.Path }}" class="circle" alt="{{ .Site.Params.Portrait.Alt }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" style="max-width:{{ .Site.Params.Portrait.Size }}" />
{{- partial "image.html" (dict "path" .Site.Params.Portrait.Path "alt" .Site.Params.Portrait.Alt "class" "circle" "style" (printf "max-width:%s" .Site.Params.Portrait.Size ))}}
{{- end }}
<h1>{{ .Site.Title }}</h1>
@@ -0,0 +1,5 @@
{{- $img := resources.Get .path }}
{{- $img = $img.Resize (printf "%dx%d webp" $img.Width $img.Height) }}
<img src="{{ $img.Permalink }}" alt="{{ .alt | default " " }}" width="{{ .width | default $img.Width }}"
height="{{ .height | default $img.Height }}" {{- if .class}}class="{{ .class }}" {{end}}
{{- if .style}}style="{{ .style | safeCSS | default " " }}" {{end}} />
+1 -1
View File
@@ -2,7 +2,7 @@
style="text-decoration: none;">
<div class="logo">
{{- if .Site.Params.Logo.path }}
<img src="{{ .Site.Params.Logo.path }}" alt="{{ .Site.Params.Logo.alt }}" />
{{- partial "image.html" (dict "path" .Site.Params.Logo.path "alt" .Site.Params.Logo.alt) }}
{{- else }}
<span class="logo__mark">></span>
<span class="logo__text">{{- with .Site.Params.Logo.logoText }}{{ . }}{{ else }}$ cd /home/{{ end }}<span
@@ -16,8 +16,9 @@
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Params.description | plainify }}{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{- with .Params.cover }}
<meta property="og:image" content="{{ . | absURL }}" />
{{- $img := imageConfig (printf "static/%s" .) }}
{{- $img := resources.Get . }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
<meta property="og:image" content="{{ $img.Permalink }}" />
<meta property="og:image:width" content="{{ $img.Width }}" />
<meta property="og:image:height" content="{{ $img.Height }}" />
{{- end }}
@@ -49,7 +50,9 @@
<!-- Twitter cards -->
<meta name="twitter:card" content="summary_large_image" />
{{- if .Params.cover }}
<meta name="twitter:image" content="{{ .Params.cover | absURL }}" />
{{- $img := resources.Get .Params.cover }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
<meta name="twitter:image" content="{{ $img.Permalink }}" />
<meta name="twitter:image:alt" content="{{ .Params.title | plainify | default " " }}" />
{{- end }}
<meta name="twitter:title" content="{{ .Title }}" />
+1 -9
View File
@@ -75,15 +75,7 @@
</div>
{{- if .Params.Cover }}
<figure class="portfolio-cover">
{{- $img := imageConfig (printf "static/%s" .Params.Cover) }}
{{- if .Params.UseRelativeCover }}
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- else }}
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- end }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ")) }}
{{- if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
@@ -35,9 +35,7 @@
{{- end }}
{{- if .Params.Cover }}
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }}
<img src="/{{ .Params.Cover }}" class="portfolio-cover" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "portfolio-cover") }}
{{- end }}
<div class="portfolio-content">
+1 -3
View File
@@ -38,9 +38,7 @@
{{- end }}
{{- if .Params.Cover }}
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }}
<img src="/{{ .Params.Cover }}" class="post-cover" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "post-cover") }}
{{- end }}
<div class="post-content">
@@ -3,10 +3,14 @@
<a href="{{ .Get "link" }}" {{ with .Get "target" }} target="{{ . }}" {{ end }}{{ with .Get "rel" }} rel="{{ . }}"
{{ end }}>
{{- end -}}
<img src="{{ .Get "src" }}" {{- if or (.Get "alt") (.Get "caption") }}
{{- if eq (.Get "raw") true }}
{{- $img := resources.Get (.Get "src") }}
<img src="{{ $img.Permalink }}" {{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" {{- end -}}
{{- with .Get "width" }} width="{{ . }}" {{ end -}} {{- with .Get "height" }} height="{{ . }}" {{ end -}} />
<!-- Closing img tag -->
width="{{ .Get "width" | default $img.Width }}" height="{{ .Get "height" | default $img.Height }}" />
{{- else }}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (or (.Get "alt") (.Get "caption" | markdownify | plainify) | default " ") "width" (.Get "width") "height" (.Get "height")) }}
{{- end }}
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption>
@@ -1,5 +1,3 @@
{{ if .Get "src" }}
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }}
class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" {{ with .Get "style" }}
style="{{ . | safeCSS }}" {{ end }} />
{{ end }}
{{- if .Get "src" }}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (.Get "alt" | plainify | default " ") "style" (.Get "style" | safeCSS | default " ") )}}
{{- end }}
+1 -10
View File
@@ -45,16 +45,7 @@
{{- if .Params.Cover }}
<figure class="post-cover">
{{- $img := imageConfig (printf "static/%s" .Params.Cover) }}
{{- if .Params.UseRelativeCover }}
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}"
alt="{{ .Title | plainify | default " " }}" width="{{ $img.Width }}"
height="{{ $img.Height }}" />
{{- else }}
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- end }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify)) }}
{{- if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
@@ -38,9 +38,7 @@
{{- end }}
{{- if .Params.Cover }}
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }}
<img src="/{{ .Params.Cover }}" class="post-cover" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "post-cover") }}
{{- end }}
<div class="post-content">