list.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{ define "title" }}{{ .Title }} – {{ .Site.Title }}{{ end }}
  2. {{ define "main" }}
  3. {{ .Content }}
  4. <div class="title-header">
  5. <h1>{{ .Title }}</h1>
  6. </div>
  7. {{- if gt (len .Sections) 0 }}
  8. <h2>Categories</h2>
  9. <ul class="section-list">
  10. {{- range .Sections }}
  11. <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
  12. {{- end }}
  13. </ul>
  14. <h2>All Posts</h2>
  15. {{- end }}
  16. {{- $cs := .CurrentSection }}
  17. {{- with $cs }}
  18. {{- range (where .Site.RegularPages "Section" .Section) }}
  19. {{- if .IsDescendant $cs }}
  20. <article class="all-list">
  21. <div class="title-list">
  22. <h3><a href="{{ .RelPermalink }}">{{ if .Draft }}<i>(Draft)</i> {{ end }}{{ .Title }}</a></h3>
  23. <div class="title-list-date">
  24. {{- if eq .Date.IsZero false }}
  25. <time>{{ .Date.Format "Monday, January 2, 2006" }}</time>
  26. {{- end }}
  27. {{- if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }}
  28. (updated)
  29. {{- end }}
  30. </div>
  31. </div>
  32. <div class="body-list">
  33. <p></p> {{/* Spacing is weird if we don't include this */}}
  34. <p>
  35. {{ .Summary }}
  36. </p>
  37. {{- if .Truncated }}
  38. <a href="{{ .RelPermalink }}">Read More…</a>
  39. {{- end }}
  40. </div>
  41. </article>
  42. {{- end }}
  43. {{- end }}
  44. {{- end }}
  45. {{ end }}