From d8a1bbee6f93eeb19d7d8de065daacc48ca3b86d Mon Sep 17 00:00:00 2001
From: Olivia206 <olivia.simonet206@gmail.com>
Date: Fri, 3 May 2024 13:20:51 +0200
Subject: [PATCH] made alternate class a mixin and fixed some displays for
 alternate posts/pages without image

---
 assets/sass/_theme/utils/blocks.sass                   | 2 +-
 layouts/partials/blocks/templates/pages/alternate.html | 2 +-
 layouts/partials/posts/post.html                       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/assets/sass/_theme/utils/blocks.sass b/assets/sass/_theme/utils/blocks.sass
index d95c4283..edbb02a2 100644
--- a/assets/sass/_theme/utils/blocks.sass
+++ b/assets/sass/_theme/utils/blocks.sass
@@ -48,7 +48,7 @@
             aspect-ratio: unset
         @include media-breakpoint-up(desktop)
             width: columns(4)
-            &:not(:first-child)
+            &:not(:first-child, .without-image)
                 margin-top: -5%
             &:nth-child(odd)
                 margin-left: auto
diff --git a/layouts/partials/blocks/templates/pages/alternate.html b/layouts/partials/blocks/templates/pages/alternate.html
index 904ae993..b01d4bc0 100644
--- a/layouts/partials/blocks/templates/pages/alternate.html
+++ b/layouts/partials/blocks/templates/pages/alternate.html
@@ -16,7 +16,7 @@
       {{ else }}
         {{ $image_class = "" }}
       {{ end }}
-      <article class="{{ $image_class }}">
+      <article class="{{ $image_class }} {{- if (not (isset .Params "image")) -}} without-image {{- end -}}">
         {{ $heading_tag.open }}
           <a href="{{- .Permalink -}}">
             {{- partial "PrepareHTML" .Title -}}
diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html
index 3173d943..b1149355 100644
--- a/layouts/partials/posts/post.html
+++ b/layouts/partials/posts/post.html
@@ -19,7 +19,7 @@
   {{- $direction = partial "GetImageDirection" .Params.image -}}
 {{ end }}
 
-<article class='post {{ if $alternate }}{{ $direction }} {{if not (modBool $index 2)}}left{{ else}}right{{end}}{{end}}' itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
+<article class='post {{ if $alternate }} {{- if (not (isset .Params "image")) -}} without-image {{- end -}}{{ $direction }} {{if not (modBool $index 2)}}left{{ else}}right{{end}}{{end}}' itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
   <div class="post-content">
     {{- $title := partial "PrepareHTML" .Title -}}
 
-- 
GitLab