diff options
author | mms <michal@sapka.me> | 2024-08-31 19:22:11 +0200 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-08-31 19:22:11 +0200 |
commit | 091aa067d036ab60eb7d627d1997572daebaa310 (patch) | |
tree | d975c020497928a05ee30c257cfc88dc943cae76 /layouts | |
parent | bcf8aee086ae1c9e66a8ca461bf0912cda5d701d (diff) |
feat(blog): rrc
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/blog/baseof.html | 7 | ||||
-rw-r--r-- | layouts/shortcodes/image.html | 6 | ||||
-rw-r--r-- | layouts/shortcodes/img-c.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/img-center.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/img-pull-right.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/img-r.html | 4 |
6 files changed, 17 insertions, 12 deletions
diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html index 37d34bf..49c7253 100644 --- a/layouts/blog/baseof.html +++ b/layouts/blog/baseof.html @@ -25,7 +25,12 @@ <meta property="og:title" content="{{ .Page.Title }}"> <meta property="og:type" content="website"> <meta property="og:url" content="{{ .Permalink }}"> - <meta property="og:image" content="{{ $header_rect.Permalink }}"> + + {{- $imageUrl := default "blog/logo/right.png" .Params.image }} + {{- $image := resources.Get $imageUrl }} + <meta property="og:image" content="{{ $image.Permalink }}"> + + <meta property="og:description" content="{{ .Params.Abstract | default .Site.Params.DefaultDescription}}"> <link rel="canonical" href="{{ .Permalink }}"> diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index 1bc0619..ee2f4a6 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -24,13 +24,13 @@ {{- $final2x_width := math.Mul $final1x_width 2}} <!-- Generate 1x and 2x images --> -{{- $img1xproc := printf "%dx webp q90" $final1x_width }} -{{- $img2xproc := printf "%dx webp q90" $final2x_width }} +{{- $img1xproc := printf "%dx jpg q90" $final1x_width }} +{{- $img2xproc := printf "%dx jpg q90" $final2x_width }} {{- $img1x := $img.Resize $img1xproc }} {{- $img2x := $img.Resize $img2xproc }} <!-- Generate raw, optimized img --> -{{- $imgproc := printf "x%d webp q90" $raw_width }} +{{- $imgproc := printf "x%d jpg q90" $raw_width }} {{- $img_raw := $img.Resize $imgproc }} <!-- Resulting HTML --> diff --git a/layouts/shortcodes/img-c.html b/layouts/shortcodes/img-c.html index 7411abb..d78c2d4 100644 --- a/layouts/shortcodes/img-c.html +++ b/layouts/shortcodes/img-c.html @@ -4,8 +4,8 @@ {{- $caption := .Inner }} {{- $source := .Get 1 }} {{- $imgclass := .Get 2 }} -{{- $img1x := $img.Resize "800x webp q90"}} -{{- $img2x := $img.Resize "1600x webp q90"}} +{{- $img1x := $img.Resize "800x jpg q90"}} +{{- $img2x := $img.Resize "1600x jpg q90"}} <figure> <a href="{{ $img.Permalink }}"> <img diff --git a/layouts/shortcodes/img-center.html b/layouts/shortcodes/img-center.html index e871a91..cca73f2 100644 --- a/layouts/shortcodes/img-center.html +++ b/layouts/shortcodes/img-center.html @@ -3,8 +3,8 @@ {{- $img := resources.Get $path }} {{- $caption := .Get 1 }} {{- $source := .Get 2 }} -{{- $img1x := $img.Resize "800x webp q90"}} -{{- $img2x := $img.Resize "1600x webp q90"}} +{{- $img1x := $img.Resize "800x jpg q90"}} +{{- $img2x := $img.Resize "1600x jpg q90"}} <figure> <img loading="lazy" diff --git a/layouts/shortcodes/img-pull-right.html b/layouts/shortcodes/img-pull-right.html index ad7cbf1..49f2ed7 100644 --- a/layouts/shortcodes/img-pull-right.html +++ b/layouts/shortcodes/img-pull-right.html @@ -1,8 +1,8 @@ {{- $file := .Get 0 }} {{- $path := printf "content_images/%s" $file}} {{- $img := resources.Get $path }} -{{- $img1x := $img.Resize "150x webp" }} -{{- $img2x := $img.Resize "300x webp" }} +{{- $img1x := $img.Resize "150x jpg" }} +{{- $img2x := $img.Resize "300x jpg" }} {{- $caption := .Get 1}} <img loading="lazy" diff --git a/layouts/shortcodes/img-r.html b/layouts/shortcodes/img-r.html index e67b32f..6ae976e 100644 --- a/layouts/shortcodes/img-r.html +++ b/layouts/shortcodes/img-r.html @@ -1,8 +1,8 @@ {{- $file := .Get 0 }} {{- $path := printf "content_images/%s" $file}} {{- $img := resources.Get $path }} -{{- $img1x := $img.Resize "150x webp" }} -{{- $img2x := $img.Resize "300x webp" }} +{{- $img1x := $img.Resize "150x jpg" }} +{{- $img2x := $img.Resize "300x jpg" }} {{- $caption := .Inner}} <img loading="lazy" ; |