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.

77 lines
2.8 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. {{ define "title" -}}
  16. {{ .Site.Title }}
  17. {{- end }}
  18. {{ define "header" }}
  19. {{ partial "masthead.html" . }}
  20. {{ end }}
  21. {{ define "main" }}
  22. <header>
  23. <h1 itemprop="name">{{ .Title }}</h1>
  24. </header>
  25. {{ with .Site.Params.layout.home.section }}
  26. {{ if ne $.Site.Params.hackcss.disabled true }}
  27. {{ with resources.Get "css/conditional/layouts/partials/page-thumbs.css" | minify }}
  28. <style>{{ .Content | safeCSS }}</style>
  29. {{ end }}
  30. {{ end }}
  31. {{ range sort . "weight" "asc" }}
  32. <section>
  33. {{ $index := site.GetPage "section" .type }}
  34. {{ $pages := where site.RegularPages "Type" .type }}
  35. {{ $page_count := (default 1 (len $pages)) }}
  36. {{ if eq $page_count 1 }}
  37. {{ partial "page-summary.html" $index }}
  38. {{ else if gt $page_count 1 }}
  39. <header>
  40. <h1 itemprop="name">
  41. <a href="{{ $index.RelPermalink }}">Recent {{ $index.Title }}</a>
  42. </h1>
  43. <blockquote itemprop="description">{{ $index.Description }}</blockquote>
  44. </header>
  45. {{ partial "page-thumbs.html" (dict "thumbnail_options" .thumbs "page_count" $page_count "limit" .limit "pages" $pages) }}
  46. {{ end }}
  47. {{ if and (lt .limit $page_count) (ne 1 $page_count) }}
  48. <nav class="readmore">
  49. <a itemprop="url" href="{{ $index.RelPermalink }}">
  50. View more {{ $index.Title }}
  51. </a>
  52. </nav>
  53. {{ end }}
  54. </section>
  55. {{ end }}
  56. {{ end }}
  57. {{ if not .Site.Params.layout.home.hide_blog }}
  58. <section itemscope itemtype="https://schema.org/Blog">
  59. {{ range (.Paginate (where .Site.RegularPages "Type" "in" (site.Params.layout.homepage.sections | default (slice "post")))).Pages }}
  60. {{ partial "page-summary.html" . }}
  61. {{ end }}
  62. </section>
  63. {{ end }}
  64. {{ end }}
  65. {{ define "footer" }}
  66. {{ if not .Site.Params.layout.home.hide_blog }}
  67. <p>{{ partial "pagination.html" . }}</p>
  68. {{ end }}
  69. <small class="muted">
  70. {{ partial "copyright-notice.html" . }}
  71. </small>
  72. {{ end }}