Convert all images to webp when possible

alternate-navbar
Maik de Kruif 3 years ago
parent 16f049dd09
commit 99c0d62efe
Signed by: maik
GPG Key ID: 44A55AD1F0673FA6
  1. 0
      assets/img/home/portrait.png
  2. 0
      assets/img/portfolio/learn-to-program/screenshot.png
  3. 0
      assets/img/portfolio/watch-together/screenshot.png
  4. 0
      assets/img/portfolio/youtube-music-desktop-player/screenshot.png
  5. 0
      assets/img/posts/adventofctf/coin.jpeg
  6. 0
      assets/img/posts/adventofctf/scoreboard.jpeg
  7. 0
      assets/img/writeups/adventofctf/2020/080b5d5fcaf13167d2e7e8871fdc8ded.png
  8. 0
      assets/img/writeups/adventofctf/2020/16/ssti_graph.png
  9. 0
      assets/img/writeups/adventofctf/2020/23/breakpoint.png
  10. 0
      assets/img/writeups/adventofctf/2020/23/websocket.png
  11. 0
      assets/img/writeups/adventofctf/2020/246397ca184f8b03ac8fecf50ee1051e.png
  12. 0
      assets/img/writeups/adventofctf/2020/24e9ce8f146f70b4189f1d2532a75208.png
  13. 0
      assets/img/writeups/adventofctf/2020/3542630bd0bb5141d94e4b40930bd69d.png
  14. 0
      assets/img/writeups/adventofctf/2020/3f12301d8715a1371d2d776d25ea6ab6.png
  15. 0
      assets/img/writeups/adventofctf/2020/497784f7a3314f8aa5b8464432e30bbe.png
  16. 0
      assets/img/writeups/adventofctf/2020/4f5cc0afbb9e7ec6a57cdd68a92b9213.png
  17. 0
      assets/img/writeups/adventofctf/2020/6c0810c1568645bcf58da67a1db6e3e7.png
  18. 0
      assets/img/writeups/adventofctf/2020/8717d728f2de96beb8123c0cca28a728.png
  19. 0
      assets/img/writeups/adventofctf/2020/948b1eb046c96865a05808660ee99e10.png
  20. 0
      assets/img/writeups/adventofctf/2020/973ded4b2381c28af6c24d3d670303c6.png
  21. 0
      assets/img/writeups/adventofctf/2020/9c6afd807a15973b962cf3aee3dbe836.png
  22. 0
      assets/img/writeups/adventofctf/2020/9fac6046540f4972c60f458b94aacb1d.png
  23. 0
      assets/img/writeups/adventofctf/2020/a4afd1fffb0b662d849a6907767f0625.png
  24. 0
      assets/img/writeups/adventofctf/2020/advent_of_ctf_coming_soon.png
  25. 0
      assets/img/writeups/adventofctf/2020/af3424cd215a6459494ae07eab33cb35.png
  26. 0
      assets/img/writeups/adventofctf/2020/b915cb528c4b3d6fc4644f73ba8b829d.png
  27. 0
      assets/img/writeups/adventofctf/2020/ba15475608ea3f8313825eec5dceac06.png
  28. 0
      assets/img/writeups/adventofctf/2020/be40bcd25e7487440a64b13cd32049b2.png
  29. 0
      assets/img/writeups/adventofctf/2020/c1f93b6ee2e1cd25ea02f9a78c364b12.png
  30. 0
      assets/img/writeups/adventofctf/2020/c366d63edd4a35c9f8bea89e57401fef.png
  31. 0
      assets/img/writeups/adventofctf/2020/d80f13d1ab714f7864c2a9ef56c5f767.png
  32. 0
      assets/img/writeups/adventofctf/2020/da781419d6bf02d0a580e48414b9cbde.png
  33. 0
      assets/img/writeups/adventofctf/2020/dd04640480d764ab09eea047cde749cd.png
  34. 0
      assets/img/writeups/adventofctf/2020/f1d6ca5572e0c012239bcf4a8f797be1.png
  35. 0
      assets/img/writeups/adventofctf/2020/f90b2bf3f08ee628c09505ff309018ed.png
  36. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/1/cctv.png
  37. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/1/cover.png
  38. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/cover.png
  39. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/gates/and.png
  40. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/gates/nand.png
  41. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/gates/nor.png
  42. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/gates/not.png
  43. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/gates/or.png
  44. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/gates/xor.png
  45. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/logic-lock-solved.png
  46. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/2/logic-lock.png
  47. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/3/cover.png
  48. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/3/cover2.png
  49. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/3/flag.png
  50. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/3/radar.png
  51. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/4/cover.png
  52. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/4/doc-functions.png
  53. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/4/doc-set-mask.png
  54. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/5/cover.png
  55. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/6/cover.png
  56. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/6/painting.jpg
  57. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/6/piet.png
  58. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/6/piet.ppm
  59. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/7/cover.png
  60. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/8/cover.png
  61. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/8/hideandseek.png
  62. 0
      assets/img/writeups/google-ctf/2021/beginners-quest/9/cover.png
  63. BIN
      assets/test.png
  64. 2
      content/writeups/google-ctf/2021/beginners-quest/8.md
  65. 10
      themes/maik-blog/layouts/_default/list.html
  66. 6
      themes/maik-blog/layouts/_default/single.html
  67. 4
      themes/maik-blog/layouts/index.html
  68. 5
      themes/maik-blog/layouts/partials/image.html
  69. 2
      themes/maik-blog/layouts/partials/logo.html
  70. 9
      themes/maik-blog/layouts/partials/meta-tags.html
  71. 10
      themes/maik-blog/layouts/portfolio/list.html
  72. 4
      themes/maik-blog/layouts/portfolio/single.html
  73. 4
      themes/maik-blog/layouts/posts/single.html
  74. 10
      themes/maik-blog/layouts/shortcodes/figure.html
  75. 8
      themes/maik-blog/layouts/shortcodes/image.html
  76. 11
      themes/maik-blog/layouts/writeups/list.html
  77. 4
      themes/maik-blog/layouts/writeups/single.html

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 400 KiB

After

Width:  |  Height:  |  Size: 400 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

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) [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._ _Note: The image is supposed to look like half is missing._

@ -44,15 +44,7 @@
{{- if .Params.Cover }} {{- if .Params.Cover }}
<figure class="post-cover"> <figure class="post-cover">
{{- $img := imageConfig (printf "static/%s" .Params.Cover) }} {{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify)) }}
{{- 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 }}
{{- if .Params.CoverCaption }} {{- if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption> <figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>

@ -23,9 +23,9 @@
<hr /> <hr />
{{- end }} {{- end }}
{{ with .Params.Cover }} {{- with .Params.Cover }}
<img src="/{{ . }}" class="post-cover" /> {{- partial "image.html" (dict "path" . "alt" "" "class" "post-cover") }}
{{ end }} {{- end }}
<div class="post-content"> <div class="post-content">
{{ .Content }} {{ .Content }}

@ -2,9 +2,7 @@
<main role="main" style=""> <main role="main" style="">
<div> <div>
{{- if .Site.Params.Portrait.Path }} {{- if .Site.Params.Portrait.Path }}
{{- $img := imageConfig (printf "static/%s" .Site.Params.Portrait.Path) }} {{- 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 ))}}
<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 }}" />
{{- end }} {{- end }}
<h1>{{ .Site.Title }}</h1> <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}} />

@ -2,7 +2,7 @@
style="text-decoration: none;"> style="text-decoration: none;">
<div class="logo"> <div class="logo">
{{- if .Site.Params.Logo.path }} {{- 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 }} {{- else }}
<span class="logo__mark">></span> <span class="logo__mark">></span>
<span class="logo__text">{{- with .Site.Params.Logo.logoText }}{{ . }}{{ else }}$ cd /home/{{ end }}<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 }}" /> content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Params.description | plainify }}{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:url" content="{{ .Permalink }}" />
{{- with .Params.cover }} {{- with .Params.cover }}
<meta property="og:image" content="{{ . | absURL }}" /> {{- $img := resources.Get . }}
{{- $img := imageConfig (printf "static/%s" .) }} {{- $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:width" content="{{ $img.Width }}" />
<meta property="og:image:height" content="{{ $img.Height }}" /> <meta property="og:image:height" content="{{ $img.Height }}" />
{{- end }} {{- end }}
@ -49,7 +50,9 @@
<!-- Twitter cards --> <!-- Twitter cards -->
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
{{- if .Params.cover }} {{- 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 " " }}" /> <meta name="twitter:image:alt" content="{{ .Params.title | plainify | default " " }}" />
{{- end }} {{- end }}
<meta name="twitter:title" content="{{ .Title }}" /> <meta name="twitter:title" content="{{ .Title }}" />

@ -75,15 +75,7 @@
</div> </div>
{{- if .Params.Cover }} {{- if .Params.Cover }}
<figure class="portfolio-cover"> <figure class="portfolio-cover">
{{- $img := imageConfig (printf "static/%s" .Params.Cover) }} {{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ")) }}
{{- 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 }}
{{- if .Params.CoverCaption }} {{- if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption> <figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>

@ -35,9 +35,7 @@
{{- end }} {{- end }}
{{- if .Params.Cover }} {{- if .Params.Cover }}
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }} {{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "portfolio-cover") }}
<img src="/{{ .Params.Cover }}" class="portfolio-cover" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- end }} {{- end }}
<div class="portfolio-content"> <div class="portfolio-content">

@ -38,9 +38,7 @@
{{- end }} {{- end }}
{{- if .Params.Cover }} {{- if .Params.Cover }}
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }} {{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "post-cover") }}
<img src="/{{ .Params.Cover }}" class="post-cover" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- end }} {{- end }}
<div class="post-content"> <div class="post-content">

@ -3,10 +3,14 @@
<a href="{{ .Get "link" }}" {{ with .Get "target" }} target="{{ . }}" {{ end }}{{ with .Get "rel" }} rel="{{ . }}" <a href="{{ .Get "link" }}" {{ with .Get "target" }} target="{{ . }}" {{ end }}{{ with .Get "rel" }} rel="{{ . }}"
{{ end }}> {{ end }}>
{{- 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 -}} alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" {{- end -}}
{{- with .Get "width" }} width="{{ . }}" {{ end -}} {{- with .Get "height" }} height="{{ . }}" {{ end -}} /> width="{{ .Get "width" | default $img.Width }}" height="{{ .Get "height" | default $img.Height }}" />
<!-- Closing img tag --> {{- 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 .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption> <figcaption>

@ -1,5 +1,3 @@
{{ if .Get "src" }} {{- if .Get "src" }}
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{- partial "image.html" (dict "path" (.Get "src") "alt" (.Get "alt" | plainify | default " ") "style" (.Get "style" | safeCSS | default " ") )}}
class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" {{ with .Get "style" }} {{- end }}
style="{{ . | safeCSS }}" {{ end }} />
{{ end }}

@ -45,16 +45,7 @@
{{- if .Params.Cover }} {{- if .Params.Cover }}
<figure class="post-cover"> <figure class="post-cover">
{{- $img := imageConfig (printf "static/%s" .Params.Cover) }} {{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify)) }}
{{- 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 }}
{{- if .Params.CoverCaption }} {{- if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption> <figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>

@ -38,9 +38,7 @@
{{- end }} {{- end }}
{{- if .Params.Cover }} {{- if .Params.Cover }}
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }} {{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "post-cover") }}
<img src="/{{ .Params.Cover }}" class="post-cover" alt="{{ .Title | plainify | default " " }}"
width="{{ $img.Width }}" height="{{ $img.Height }}" />
{{- end }} {{- end }}
<div class="post-content"> <div class="post-content">

Loading…
Cancel
Save