index.html 1.0 KB

123456789101112131415161718192021222324252627282930
  1. {{ define "main" }}
  2. {{ .Content }}
  3. {{ if gt ( len ( where .Site.RegularPages "Section" "posts" )) 0 }}
  4. <h2>Recent Posts</h2>
  5. {{ range first 2 ( where .Site.RegularPages "Section" "posts" ) }}
  6. <article class="all-list">
  7. <div class="title-list">
  8. <h3><a href="{{ .RelPermalink }}">{{ if .Draft }}<i>(Draft)</i> {{ end }}{{ .Title }}</a></h3>
  9. <div class="title-list-date">
  10. {{ if eq .Date.IsZero false }}
  11. <time>{{ .Date.Format "Monday, January 2, 2006" }}</time>
  12. {{ end }}
  13. {{ if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }}
  14. (updated)
  15. {{ end }}
  16. </div>
  17. </div>
  18. <div class="body-list">
  19. <p></p> {{/* Spacing is weird if we don't include this */}}
  20. <p>
  21. {{ .Summary }}
  22. </p>
  23. {{ if .Truncated }}
  24. <a href="{{ .RelPermalink }}">Read More…</a>
  25. {{ end }}
  26. </div>
  27. </article>
  28. {{ end }}
  29. {{ end }}
  30. {{ end }}