Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.html 1.1KB

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