From d91b2eaee93cd8156c0e276a3f48256c2fb47a1d Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 25 Mar 2024 14:26:23 +0200 Subject: [PATCH] Rename variables (#441) --- src/layouts/partials/author-info.html | 23 ++++++++++++----------- src/layouts/partials/hero.html | 10 +++++----- src/layouts/partials/social.html | 6 +++--- src/layouts/partials/video.html | 4 ++-- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/layouts/partials/author-info.html b/src/layouts/partials/author-info.html index 7e5768f92..ca685a158 100644 --- a/src/layouts/partials/author-info.html +++ b/src/layouts/partials/author-info.html @@ -3,19 +3,20 @@ {{- $author := .context.Page.Params.author -}} {{- $date := .context.Date -}}
- {{ $author_url := urls.JoinPath "https://github.com" $author -}} - - {{ $avatar_width := 32 -}} - {{- $avatar_width_2x := mul $avatar_width 2 -}} - {{- $img_url := printf "%s%s%d" $author_url ".png?size=" $avatar_width -}} - {{- $img_url_2x := printf "%s%s%d" $author_url ".png?size=" $avatar_width_2x -}} + {{ $authorUrl := urls.JoinPath "https://github.com" $author -}} + + {{ $avatarWidth := 32 -}} + {{- $avatarWidth2x := mul $avatarWidth 2 -}} + {{- $avatarHeight := $avatarWidth -}} + {{- $imgUrl := printf "%s%s%d" $authorUrl ".png?size=" $avatarWidth -}} + {{- $imgUrl2x := printf "%s%s%d" $authorUrl ".png?size=" $avatarWidth2x -}} + {{ if eq .lazyload true }}loading="lazy"{{ end }} + width="{{ $avatarWidth }}" + height="{{ $avatarHeight }}"> @{{ $author }} diff --git a/src/layouts/partials/hero.html b/src/layouts/partials/hero.html index fce9a6a56..87912b058 100644 --- a/src/layouts/partials/hero.html +++ b/src/layouts/partials/hero.html @@ -1,12 +1,12 @@
- {{ $img_path := "/assets/brand/bootstrap-logo-shadow.png" -}} - {{- $img_path_2x := "/assets/brand/bootstrap-logo-shadow@2x.png" -}} - {{- with (imageConfig (path.Join "/src/static" $img_path)) -}} + {{ $imgPath := "/assets/brand/bootstrap-logo-shadow.png" -}} + {{- $imgPath2x := "/assets/brand/bootstrap-logo-shadow@2x.png" -}} + {{- with (imageConfig (path.Join "/src/static" $imgPath)) -}} Bootstrap diff --git a/src/layouts/partials/social.html b/src/layouts/partials/social.html index 6001c300f..4545a1b22 100644 --- a/src/layouts/partials/social.html +++ b/src/layouts/partials/social.html @@ -1,16 +1,16 @@ {{- $author := "" -}} -{{- $author_twitter := "" -}} +{{- $authorTwitter := "" -}} {{- if isset .Page.Params "author" -}} {{- $author = (index .Site.Data.authors .Page.Params.author).name -}} - {{- $author_twitter = (index .Site.Data.authors .Params.author).twitter -}} + {{- $authorTwitter = (index .Site.Data.authors .Params.author).twitter -}} {{- end -}} {{ template "_internal/twitter_cards.html" . -}} {{- /* Manually add `twitter:creator` since Hugo's internal shortcode has some issues */ -}} - + {{ template "_internal/opengraph.html" . -}} diff --git a/src/layouts/partials/video.html b/src/layouts/partials/video.html index 0f1527d6d..53a0e4ef9 100644 --- a/src/layouts/partials/video.html +++ b/src/layouts/partials/video.html @@ -2,11 +2,11 @@ {{- $lazyload := .lazyload -}} {{- $video := .context.Params.video -}} -{{- $video_start := .context.Params.video_start -}} +{{- $videoStart := .context.Params.video_start -}}