list.html 745 B

123456789101112131415161718
  1. {{ define "main" }}
  2. <div class="panel space-y-2">
  3. {{ .Content }}
  4. </div>
  5. {{ range .Pages.ByPublishDate.Reverse }}
  6. {{- $images := default (slice "/imgs/no-image-new.webp" "/imgs/no-image-new.png") .Params.Images }}
  7. {{- $altText := default "No alt text" .Params.ImageAltText }}
  8. <div class="panel my-2">
  9. <h2 id="{{ .Section }}-{{ .Title | anchorize }}"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
  10. <div class="flex flex-row flex-wrap md:flex-nowrap mt-2">
  11. <span class="image-wrapper w-full h-32 md:w-32 md:h-32">
  12. <img srcset="{{ delimit $images ", " }}" src="{{ index (last 1 $images) 0 }}" alt="{{ $altText }}" />
  13. </span>
  14. <p class="m-2 flex-1">{{ .Params.Intro | markdownify }}</p>
  15. </div>
  16. </div>
  17. {{ end }}
  18. {{ end }}