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.

index.html 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {{ define "main" }}
  2. <main class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy mid-gray">
  3. {{ .Content }}
  4. </main>
  5. {{/* For Hugo 0.20 this will default to the section with the most number of pages. */}}
  6. {{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
  7. {{/* Create a variable to use the same section twice. */}}
  8. {{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
  9. {{ if $section }}
  10. <div class="pa3 pa4-ns w-100 w-70-ns center">
  11. <h1 class="flex-none">
  12. Recent Articles
  13. </h1>
  14. <section class="w-100 mw8">
  15. {{ range (first 3 $section) }}
  16. <div class="relative w-100 mb4">
  17. {{ partial "summary-with-image.html" . }}
  18. </div>
  19. {{ end }}
  20. </section>
  21. <section class="w-100">
  22. <h1 class="f3">More Posts</h1>
  23. {{/* Nest the requirements, "after" then "first" on the outside */}}
  24. {{ range (first 4 (after 3 $section)) }}
  25. <h2 class="f5 fw4 mb4 dib mr3">
  26. <a href="{{ .URL }}" class="link black dim">
  27. {{ .Title }}
  28. </a>
  29. </h2>
  30. {{ end }}
  31. <a href="/post/" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">All Posts</a>
  32. </section>
  33. </div>
  34. {{ end }}
  35. {{ end }}