list.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. {{ partial "head_single.html" . }}
  4. <!-- <head>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge, Chrome=1">
  8. <meta http-equiv="Cache-Control" content="no-cache">
  9. <title>ChoozMo AI-PR Service</title>
  10. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
  11. integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  12. <link rel="stylesheet" href="//use.fontawesome.com/releases/v5.11.2/css/all.css">
  13. <link rel="stylesheet" href="/css/style.css">
  14. <link rel="stylesheet" href="/css/custom.css">
  15. </head> -->
  16. <body>
  17. {{ partial "navbar.html" . }}
  18. <main class="container news-content" style="overflow-x: hidden;">
  19. <ul id="categories">
  20. <li>
  21. <button id="all">
  22. <a href="/main-news/">所有訊息</a>
  23. </button>
  24. </li>
  25. <li>
  26. <button id="focus">
  27. <a href="/main-news/focus/">焦點訊息</a>
  28. </button>
  29. </li>
  30. <li>
  31. <button id="serve">
  32. <a href="/main-news/serve/">最新服務</a>
  33. </button>
  34. </li>
  35. <li>
  36. <button id="event">
  37. <a href="/main-news/event/">活動公告</a>
  38. </button>
  39. </li>
  40. </ul>
  41. {{ if eq (relURL .URL) ("/main-news/focus/") }}
  42. {{ $t := $.Site.GetPage "/main-news" }}
  43. <ul class="list">
  44. {{ range $index, $element := where $t.Pages "Params.categories" "焦點訊息" }}
  45. {{ $t := $.Site.GetPage "/main-news" }}
  46. <li>
  47. <a href="{{ .RelPermalink }}">
  48. <h2>{{ .Title }}</h2>
  49. </a>
  50. <hr>
  51. <section class="d-flex justify-content-between">
  52. <p class="news-category">{{ .Params.categories }}</p>
  53. <p>{{ .PublishDate.Format "2006-01-02" }}</p>
  54. </section>
  55. <a href="{{ .RelPermalink }}" class="content">
  56. <p>{{.Summary}}</p>
  57. </a>
  58. <div class="more-btn">
  59. <a href="{{ .RelPermalink }}">
  60. 閱讀文章
  61. </a>
  62. </div>
  63. </li>
  64. {{ end }}
  65. </ul>
  66. {{ end }}
  67. {{ if eq (relURL .URL) ("/main-news/serve/") }}
  68. {{ $t := $.Site.GetPage "/main-news" }}
  69. <ul class="list">
  70. {{ range $index, $element := where $t.Pages "Params.categories" "最新服務" }}
  71. {{ $t := $.Site.GetPage "/main-news" }}
  72. <li>
  73. <a href="{{ .RelPermalink }}">
  74. <h2>{{ .Title }}</h2>
  75. </a>
  76. <hr>
  77. <section class="d-flex justify-content-between">
  78. <p class="news-category">{{ .Params.categories }}</p>
  79. <p>{{ .PublishDate.Format "2006-01-02" }}</p>
  80. </section>
  81. <a href="{{ .RelPermalink }}" class="content">
  82. <p>{{.Summary}}</p>
  83. </a>
  84. <div class="more-btn">
  85. <a href="{{ .RelPermalink }}">
  86. 閱讀文章
  87. </a>
  88. </div>
  89. </li>
  90. {{ end }}
  91. </ul>
  92. {{ end }}
  93. {{ if eq (relURL .URL) ("/main-news/event/") }}
  94. {{ $t := $.Site.GetPage "/main-news" }}
  95. <ul class="list">
  96. {{ range $index, $element := where $t.Pages "Params.categories" "活動公告" }}
  97. {{ $t := $.Site.GetPage "/main-news" }}
  98. <li>
  99. <a href="{{ .RelPermalink }}">
  100. <h2>{{ .Title }}</h2>
  101. </a>
  102. <hr>
  103. <section class="d-flex justify-content-between">
  104. <p class="news-category">{{ .Params.categories }}</p>
  105. <p>{{ .PublishDate.Format "2006-01-02" }}</p>
  106. </section>
  107. <a href="{{ .RelPermalink }}" class="content">
  108. <p>{{.Summary}}</p>
  109. </a>
  110. <div class="more-btn">
  111. <a href="{{ .RelPermalink }}">
  112. 閱讀文章
  113. </a>
  114. </div>
  115. </li>
  116. {{ end }}
  117. </ul>
  118. {{ end }}
  119. {{ $paginator := .Paginate .Data.Pages }}
  120. <ul class="list">
  121. {{ range $paginator.Pages }}
  122. {{ $t := $.Site.GetPage "/main-news" }}
  123. {{ if ne .Params.categories "url" }} <!-- 排除分類用的 content -->
  124. <li>
  125. <a href="{{ .RelPermalink }}">
  126. <h2>{{ .Title }}</h2>
  127. </a>
  128. <hr>
  129. <section class="d-flex justify-content-between">
  130. <p class="news-category">{{ .Params.categories }}</p>
  131. <p>{{ .PublishDate.Format "2006-01-02" }}</p>
  132. </section>
  133. <a href="{{ .RelPermalink }}" class="content">
  134. <p>{{.Summary}}</p>
  135. </a>
  136. <div class="more-btn">
  137. <a href="{{ .RelPermalink }}">
  138. 閱讀文章
  139. </a>
  140. </div>
  141. </li>
  142. {{ end }}
  143. {{ end }}
  144. </ul>
  145. </main>
  146. {{ partial "footer.html" . }}
  147. <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"
  148. integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
  149. crossorigin="anonymous"></script>
  150. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js"
  151. integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF"
  152. crossorigin="anonymous"></script>
  153. <script src="//code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
  154. crossorigin="anonymous"></script>
  155. <script>
  156. let pathname = window.location.pathname;
  157. $('.news-content button').removeClass('active');
  158. if (pathname.includes('focus')) {
  159. $('.news-content #focus').addClass('active');
  160. } else if (pathname.includes('serve')) {
  161. $('.news-content #serve').addClass('active');
  162. } else if (pathname.includes('event')) {
  163. $('.news-content #event').addClass('active');
  164. } else {
  165. $('.news-content #all').addClass('active');
  166. }
  167. </script>
  168. </body>
  169. </html>