You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.9 KiB

4 years ago
  1. {{/*
  2. Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
  3. This file is part of After Dark.
  4. After Dark is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Affero General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. After Dark is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */ -}}
  15. <ul class="thumbnail grid" itemscope itemtype="https://schema.org/ItemList">
  16. <meta itemprop="itemListOrder" content="Unordered">
  17. <meta itemprop="name" content="{{ .index.Title }}">
  18. <meta itemprop="numberOfItems" content="{{ (default .page_count .limit) }}">
  19. {{ $thumbnail_options := .thumbnail_options }}
  20. {{ $show_readingtime := .show_readingtime }}
  21. {{ range first (default .page_count .limit) .pages }}
  22. {{ $page_schema := .Params.schema }}
  23. {{ $section_schema := (.Site.GetPage "section" .Page.Type).Params.schema }}
  24. {{ $schema_type := (default $section_schema.type $page_schema.type) | default "Thing" }}
  25. <li class="cell" itemprop="itemListElement" itemscope itemtype="https://schema.org/{{ $schema_type }}">
  26. <a itemprop="url" href="{{ .RelPermalink }}">
  27. {{ partial "image/thumbnail.html" (dict "node" . "options" $thumbnail_options) }}
  28. <h2 itemprop="name">{{ .Title }}</h2>
  29. </a>
  30. <small itemprop="description">
  31. {{ .Description }}
  32. {{ if $show_readingtime }}
  33. <time class="muted" datetime="{{ .ReadingTime }}M">{{ .ReadingTime }} minutes</time>
  34. {{ end }}
  35. </small>
  36. </li>
  37. {{ end }}
  38. </ul>