mirror of https://github.com/onweru/compose.git

weru
23.15.2025 478f5b77f14052fa7228851695be877e2ba7a0aa
layouts/blog/list.html
@@ -1,23 +1,23 @@
{{ define "main" }}
{{- $pages := where site.RegularPages "Section" site.Params.blogDir  }}
{{- $pages := where site.RegularPages "Section" site.Params.blogDir }}
<div class="wrap pt-2 mt-2">
  {{- $paginator := .Paginate $pages -}}
  {{- $size := $paginator.PagerSize }}
  {{- $scratch := newScratch }}
  {{- range $index, $value := $paginator.Pages }}
    {{- if isset .Params "image" }}
      {{- $scratch.Set "image" .Params.image }}
    {{- else }}
      {{- $scratch.Set "image" "thumbnail.svg" }}
    {{- end }}
    {{- $image := $scratch.Get "image" }}
    {{- $bg := $image }}
    {{- if ne (in $image "images") true }}
      {{- $bg = (absURL (printf "images/%s" $image)) }}
    {{- end }}
    {{- if in $image "https://" }}
      {{- $bg = $image }}
    {{- end }}
  {{- if isset .Params "image" }}
  {{- $scratch.Set "image" .Params.image }}
  {{- else }}
  {{- $scratch.Set "image" "thumbnail.svg" }}
  {{- end }}
  {{- $image := $scratch.Get "image" }}
  {{- $bg := $image }}
  {{- if ne (in $image "images") true }}
  {{- $bg = (absURL (printf "images/%s" $image)) }}
  {{- end }}
  {{- if in $image "https://" }}
  {{- $bg = $image }}
  {{- end }}
  <article class="article mb-2">
    <a href="{{ $value.Permalink }}" {{ if eq $index 0 }} class="grid-reverse" {{ end }}>
      <div class="article_thumb" style="background-image: url({{ $bg }});"></div>
@@ -25,13 +25,13 @@
        <div class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</div>
        <h3 class="article_title">{{ $value.Title }}</h3>
        <div class="article_excerpt {{ if eq $index 0 }} visible {{ end }}">
        <p>{{ truncate 100 $value.Summary }}</p>
          <p>{{ truncate 100 $value.Summary }}</p>
        </div>
      </div>
    </a>
  </article>
  {{- if and (eq $index 0) (gt $size 1)  }}<div class="grid-2 article_showcase">{{ end }}
  {{- if and (eq $index (add $size -1)) (gt $size 1) }}</div>{{ end }}
  {{- if and (eq $index 0) (gt $size 1) }}<div class="grid-2 article_showcase">{{ end }}
    {{- if and (eq $index (add $size -1)) (gt $size 1) }}</div>{{ end }}
  {{- end }}
</div>
</div>
@@ -42,4 +42,4 @@
  </svg>
  </span>
</a> -->
{{- end }}
{{- end }}