sidebar.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <div class="col-lg-4">
  2. <div class="widget search-box">
  3. <form action="{{ site.BaseURL }}/search">
  4. <i class="ti-search"></i>
  5. <input class="form-control border-0 pl-5" type="search" placeholder="Search" id="search-query" name="s">
  6. </form>
  7. </div>
  8. <div class="widget">
  9. <h6 class="mb-4">最新文章</h6>
  10. {{ range first 3 ( where site.Pages "Type" "post") }}
  11. <div class="media mb-4">
  12. <div class="post-thumb-sm mr-3">
  13. <a href="{{ .Permalink }}"><img class="mr-3 post-thumb-sm" src="{{ .Params.Image | absURL }}"></a>
  14. </div>
  15. <div class="media-body">
  16. <ul class="list-inline d-flex justify-content-between mb-2">
  17. <li class="list-inline-item">Post By {{site.Params.author}}</li>
  18. <li class="list-inline-item">{{ .PublishDate.Format "Jan 02, 2006" }}</li>
  19. </ul>
  20. <h6><a class="text-dark" href="{{ .Permalink }}">{{.Title}}</a></h6>
  21. </div>
  22. </div>
  23. {{ end }}
  24. </div>
  25. <div class="widget">
  26. <h6 class="mb-4">標籤</h6>
  27. {{- if isset site.Taxonomies "tags" }}
  28. {{- if not (eq (len site.Taxonomies.tags) 0) }}
  29. <ul class="list-inline tag-list">
  30. {{- range $name, $items := site.Taxonomies.tags }}
  31. <li class="list-inline-item m-1"><a href="{{ "tags/" | relLangURL }}{{ $name | urlize | lower }}">{{ $name | humanize }}</a></li>
  32. {{- end }}
  33. </ul>
  34. {{- end }}
  35. {{- end }}
  36. </div>
  37. <div class="widget">
  38. <h6 class="mb-4">分類</h6>
  39. {{- if isset site.Taxonomies "categories" }}
  40. {{- if not (eq (len site.Taxonomies.categories) 0) }}
  41. <ul class="list-inline tag-list">
  42. {{- range $name, $items := site.Taxonomies.categories }}
  43. <li class="list-inline-item m-1"><a href="{{ "categories/" | relLangURL }}{{ $name | urlize | lower }}">{{ $name | title | humanize }}</a></li>
  44. {{- end }}
  45. </ul>
  46. {{- end }}
  47. {{- end }}
  48. </div>
  49. </div>