single.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {{ define "header" }}
  2. {{ partial "header.html" . }}
  3. {{ end }}
  4. {{ define "main" }}
  5. {{- with .Params.featuredImg }}
  6. <div id="bg-img" class="bg-img" style="background-image: url({{.}});" onclick="showContent()"></div>
  7. {{- end }}
  8. <main class="site-main section-inner animated fadeIn faster">
  9. <article class="thin">
  10. <header class="post-header">
  11. <div class="post-meta"><span>{{ .Date.Format .Site.Params.dateform }}</span></div>
  12. <h1>{{ .Title }}</h1>
  13. </header>
  14. <div class="content">
  15. {{ .Content }}
  16. </div>
  17. <hr class="post-end">
  18. <footer class="post-info">
  19. {{- with .Params.tags }}
  20. <p>
  21. <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-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>
  22. {{- range . -}}
  23. <span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}">{{.}}</a></span>
  24. {{- end }}
  25. </p>
  26. {{- end }}
  27. <p><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-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>{{ .WordCount }} Words</p>
  28. <p><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-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}</p>
  29. {{- if .GitInfo }}
  30. <p><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-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="https://github.com/Track3/my-hugo-blog/commit/{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}</p>
  31. {{- end }}
  32. </footer>
  33. </article>
  34. <div class="post-nav thin">
  35. {{- with .NextInSection }}
  36. <a class="next-post" href="{{ .Permalink }}">
  37. <span class="post-nav-label"><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-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>&nbsp;Newer</span><br><span>{{ .Title }}</span>
  38. </a>
  39. {{- end }}
  40. {{- with .PrevInSection }}
  41. <a class="prev-post" href="{{ .Permalink }}">
  42. <span class="post-nav-label">Older&nbsp;<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-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg></span><br><span>{{ .Title }}</span>
  43. </a>
  44. {{- end }}
  45. </div>
  46. {{ partial "comments.html" . }}
  47. </main>
  48. {{ end }}
  49. {{ define "footer" }}
  50. {{ partial "footer.html" . }}
  51. <script>let haveHeader = true, haveComments = true;</script>
  52. {{ end }}