taxonomy.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {{ define "main" }}
  2. <div class="top">
  3. <header class="main">
  4. <div class="sv" data-view="full">
  5. {{ partial "header/taxo-header.html" . }}
  6. </div>
  7. </header>
  8. </div>
  9. <div class="mid">
  10. <main class="main">
  11. <div class="sv" data-view="full">
  12. {{ $paginator := .Paginate (.Pages.GroupByDate (.Site.Params.taxoGroupByDate | default "2006")) .Site.Params.taxoPaginate }}
  13. {{ range ($paginator).PageGroups }}
  14. <span class="taxo__key">{{ .Key }}</span>
  15. <ul class="taxo__ul">
  16. {{ range .Pages }}
  17. <li class="taxo__li">
  18. <a href="{{ .Permalink }}" class="taxo__title">{{ .Title }}</a>
  19. </li>
  20. {{ end }}
  21. </ul>
  22. {{ end }}
  23. {{ partial "main/component/pagination.html" . }}
  24. </div>
  25. </main>
  26. </div>
  27. <script>
  28. var singleViewElem = document.querySelectorAll('.sv');
  29. enquire.register("screen and (max-width:1280px)", {
  30. match: function () {
  31. singleViewElem.forEach(function (elem) {
  32. elem.setAttribute('data-view', 'full');
  33. });
  34. },
  35. unmatch: function () {
  36. singleViewElem.forEach(function (elem) {
  37. elem.setAttribute('data-view', 'full');
  38. });
  39. },
  40. }).register("screen and (max-width:769px)", {
  41. match: function () {
  42. singleViewElem.forEach(function (elem) {
  43. elem.setAttribute('data-view', 'mobile');
  44. });
  45. },
  46. unmatch: function () {
  47. singleViewElem.forEach(function (elem) {
  48. elem.setAttribute('data-view', 'full');
  49. });
  50. },
  51. });
  52. </script>
  53. {{ end }}