Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.html 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  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. <div class="pa3 pa4-ns w-100 w-70-ns center">
  6. <h1 class="flex-none">
  7. Recent Articles
  8. </h1>
  9. {{/* Create a variable to use the same section twice. Note that we've included the date here. */}}
  10. {{ $section := where .Data.Pages.ByDate.Reverse "Section" "article" }}
  11. <section class="w-100 mw8">
  12. {{ range (first 3 $section) }}
  13. <div class="relative w-100 mb4">
  14. {{ .Render "summary-with-image" }}
  15. </div>
  16. {{ end }}
  17. </section>
  18. <section class="w-100">
  19. <h1 class="f3">More posts</h1>
  20. {{/* Nest the requirements, "after" then "first" on the outside */}}
  21. {{ range (first 4 (after 1 $section)) }}
  22. <h2 class="f5 fw4 mb4 dib mr3">
  23. <a href="{{ .URL }}" class="link black dim">
  24. {{ .Title }}
  25. </a>
  26. </h2>
  27. {{ end }}
  28. <a href="/article/" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">All Posts</a>
  29. </section>
  30. </div>
  31. {{ end }}