index.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {{ define "head" }}
  2. {{ if .Site.Params.bgImg -}}
  3. <style>:root{ --bg-img: url({{.Site.Params.bgImg | absURL}});}</style>
  4. {{- end -}}
  5. {{.Scratch.Set "pageClass" "home"}}
  6. {{ end }}
  7. {{ define "main" }}
  8. <div id="home-center">
  9. <h1 id="home-title">{{.Site.Title}}</h1>
  10. {{- with .Site.Params.social }}
  11. <div id="home-social">
  12. {{ partialCached "social-icons.html" . }}
  13. </div>
  14. {{- end }}
  15. <nav id="home-nav">
  16. {{- range .Site.Menus.main }}
  17. <a href="{{ .URL }}">{{ .Name }}</a>
  18. {{- end }}
  19. </nav>
  20. <div id="recent-posts">
  21. <div>Recent Posts</div>
  22. <ul class="recent-posts-list">
  23. {{ range first 3 (where site.RegularPages "Type" "in" "writing") -}}
  24. <li>
  25. <span>{{ .Date.Format .Site.Params.dateformNum }} </span>
  26. <a href="{{.Permalink}}">{{.Title}}</a>
  27. </li>
  28. {{ end }}
  29. </ul>
  30. </div>
  31. </div>
  32. <div id="home-footer">
  33. <p>
  34. &copy; {{ now.Format "2006" }} <a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a>
  35. {{- with (not (in (.Site.Language.Get "disableKinds") "RSS")) }} &#183; <a href="{{ "writing/index.xml" | absURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a>{{ end }}
  36. </p>
  37. </div>
  38. {{ end }}