From 2c130e8e6dea727c025a867bd536c11005860e0f Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 22 Jan 2024 09:38:50 +0200 Subject: [PATCH] Minor layout tweaks (#418) --- src/layouts/_default/home.html | 2 +- src/layouts/_default/videos.html | 2 +- src/layouts/partials/social.html | 4 +++- src/layouts/partials/video.html | 9 ++++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/layouts/_default/home.html b/src/layouts/_default/home.html index c1ee6ba59..b27e64b80 100644 --- a/src/layouts/_default/home.html +++ b/src/layouts/_default/home.html @@ -1,7 +1,7 @@ {{ define "main" }}
- {{ $paginator := .Paginate (where site.RegularPages "Type" "posts") }} + {{ $paginator := .Paginate (where site.RegularPages "Type" "posts") -}} {{- range $i, $page := $paginator.Pages -}} {{- /* Don't lazyload the first video in each page */ -}} {{- $lazyload := cond (eq $i 0) false true -}} diff --git a/src/layouts/_default/videos.html b/src/layouts/_default/videos.html index 9aff332b2..79b21b8ec 100644 --- a/src/layouts/_default/videos.html +++ b/src/layouts/_default/videos.html @@ -1,6 +1,6 @@ {{ define "main" }} {{ $postsWithVideos := where (where site.RegularPages "Type" "posts") ".Params.video" "!=" nil -}} -{{- range $index, $post := $postsWithVideos }} +{{- range $index, $post := $postsWithVideos -}} {{- if eq $index 0 -}}
{{- end }} diff --git a/src/layouts/partials/social.html b/src/layouts/partials/social.html index db161712f..6001c300f 100644 --- a/src/layouts/partials/social.html +++ b/src/layouts/partials/social.html @@ -13,8 +13,10 @@ {{ template "_internal/opengraph.html" . -}} + {{- /* Manually add `og:image`'s dimensions since Hugo's internal shortcode doesn't do it */ -}} -{{ with (imageConfig (path.Join "src/static" (index $.Site.Params.images 0))) -}} +{{- $socialImage := path.Join "src/static" (index $.Site.Params.images 0) -}} +{{- with imageConfig $socialImage -}} {{- end }} diff --git a/src/layouts/partials/video.html b/src/layouts/partials/video.html index b1a053e4d..0f1527d6d 100644 --- a/src/layouts/partials/video.html +++ b/src/layouts/partials/video.html @@ -5,5 +5,12 @@ {{- $video_start := .context.Params.video_start -}}
- +