single.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {{ define "main" }}
  2. <div class="container">
  3. <div class="row my-5 justify-content-center">
  4. <div class="col-12 col-lg-9">
  5. <header>
  6. {{ partial "post-title" . }}
  7. <!-- {{ partial "post-tags" . }} -->
  8. <!-- {{ partial "post-categories" . }} -->
  9. <hr>
  10. </header>
  11. <article class="blog-post content">
  12. {{ $toc := .TableOfContents }}
  13. {{ $hasToc := in $toc "<a href=" }}
  14. {{ if $hasToc }}
  15. <div class=" toc-container">
  16. <span class="title">內容目錄</span>
  17. {{ $toc }}
  18. </div>
  19. {{ end }}
  20. <article class="content pt-2">
  21. {{ if eq .Params.image "cover.jpg" }}
  22. {{ else }}
  23. <img src="{{.Params.Image | absURL }}" alt="post-thumb" class="img-fluid rounded float-left mr-5 mb-4">
  24. {{ end }}
  25. {{.Content}}
  26. </article>
  27. <!-- {{ partial "translations.html" . }} -->
  28. <!-- {{ partial "related" . }} -->
  29. <hr>
  30. <a href="javascript:;" onclick="historyBack()" class="back-link mt-4">
  31. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left mb-1"
  32. viewBox="0 0 16 16">
  33. <path fill-rule="evenodd"
  34. d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
  35. </svg>
  36. <span>回到上一頁</span>
  37. </a>
  38. </article>
  39. </div>
  40. <div class="col-12 col-lg-3 position-relative mt-2 mt-lg-0">
  41. {{ partial "sidebar.html" . }}
  42. <!-- {{ partial "news-featured.html" . }}
  43. {{ partial "taxonomies.html" . }} -->
  44. </div>
  45. </div>
  46. </div>
  47. {{ end }}