Kaynağa Gözat

update blog search

SyuanYu 2 yıl önce
ebeveyn
işleme
77c6176bd4

+ 46 - 20
layouts/blog/list.html

@@ -20,7 +20,7 @@
           <li class="breadcrumb-item"><a href="#"><img src="/img/bt_footer_index@2x.png" width="30px" alt=""
                 style="margin-bottom: 5px;"></a></li>
           <li class="breadcrumb-item"><a href="#">成家知識專欄</a></li>
-          <li class="breadcrumb-item active" aria-current="page">預售屋客變</li>
+          <li class="breadcrumb-item active" aria-current="page" id="category_name">預售屋客變</li>
         </ol>
       </nav>
       <div class="d-flex flex-column align-items-start">
@@ -46,20 +46,17 @@
 
     <div style="border-top: 1px solid #969696;"></div>
 
-    <!-- <div class="alert d-flex align-items-center" role="alert" style="max-width: 300px;margin: auto;justify-content: center;">
-      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-exclamation-triangle-fill flex-shrink-0 me-2" style="color: #808e4c;" viewBox="0 0 16 16" role="img" aria-label="Warning:">
-        <path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
-      </svg>
-      <div>
-        找不到符合條件的文章
-      </div>
-    </div> -->
-
     <div class="article" id="articleList">
 
+      <div id="blog-loading" class="d-flex justify-content-center mb-5">
+        <div class="spinner-border text-success" role="status" style="color: rgba(128, 143, 76, 1) !important;">
+          <span class="visually-hidden">Loading...</span>
+        </div>
+      </div>
+
       {{ $paginator := .Paginate .Data.Pages }}
       {{ range $paginator.Pages }}
-      <div class="article-item">
+      <!-- <div class="article-item" id="defaultArticle">
         <a href="{{ .RelPermalink }}">
           <img src="{{ .Params.Image | relURL }}" alt="">
         </a>
@@ -71,9 +68,8 @@
           <a href="{{ .RelPermalink }}" class="description">
             <p style="letter-spacing: 1px;">{{.Params.description }}</p>
           </a>
-          <!-- <p style="color:#4D4D4D;">{{ .Summary }}</p> -->
         </div>
-      </div>
+      </div> -->
       {{ end }}
     </div>
     <a class="nav-link article_readMore" href="/blog_main/">< 回到成家知識庫</a>
@@ -89,6 +85,14 @@
       // 取得 apiData
       let contentsData = [];
       let category = localStorage.getItem('category');
+      console.log('category_name', document.getElementById('category_name').textContent);
+
+      if (category !== null) {
+        document.getElementById('category_name').textContent = category;
+
+      } else {
+        document.getElementById('category_name').style.display = 'none';
+      }
 
       (function getContentsData() {
         // 線上版網址 http://192.53.174.202:9001/api/
@@ -96,9 +100,10 @@
         fetch('http://localhost:9001/api/contents?url=/blog').then(res => res.json()).then(list => {
           contentsData = list;
           console.log('contentsData', contentsData);
-          if (category !== null) {
-            filterCategory();
-          }
+          filterCategory();
+          // if (category !== null) {
+          //   filterCategory();
+          // }
         })
       })();
 
@@ -107,9 +112,10 @@
       // 分類篩選
       function filterCategory() {
         contentsData.map(item => {
-          if (item.categories) {
-            if (item.categories.includes(category)) {
-              matchContent += `
+          if (category !== null) {
+            if (item.categories) {
+              if (item.categories.includes(category)) {
+                matchContent += `
             <div class="article-item">
               <a href="${item.url}">
                 <img src="${item.image}" alt="">
@@ -124,11 +130,29 @@
                 </a>
               </div>
             </div>`
+              }
             }
+          } else {
+            matchContent += `
+            <div class="article-item">
+              <a href="${item.url}">
+                <img src="${item.image}" alt="">
+              </a>
+              <div class="d-flex flex-column">
+                <a href="${item.url}">
+                  <h4>${item.title}</h4>
+                </a>
+                <p class="mt-auto my-2 fw-bold">${item.date.substr(0, 10)}</p>
+                <a href="${item.url}" class="description">
+                  <p style="letter-spacing: 1px;">${item.description}</p>
+                </a>
+              </div>
+            </div>`
           }
-
         })
+        $('#blog-loading').addClass("blog_loading");
         document.getElementById("articleList").innerHTML = matchContent;
+
       }
 
       // 增加延遲(待輸入完成後再進行搜尋)
@@ -142,6 +166,8 @@
 
       // 搜尋
       $('#blog_search').keyup(delay(function (e) {
+        // 搜尋全部文章需移除分類麵包屑
+        document.getElementById('category_name').style.display = 'none';
         // 取得輸入框的值
         let inputVal = $('#blog_search').val();
         matchContent = "";

+ 3 - 3
layouts/blog/single.html

@@ -9,9 +9,9 @@
         <div class="d-flex justify-content-between align-items-center">
           <span>{{ .PublishDate.Format "2006-01-02" }}</span>
           <div class="icon-box">
-            <a href=""><img src="/img/icon_fb@2x.png" alt=""></a>
-            <a href=""><img src="/img/icon_line@2x.png" alt=""></a>
-          </div>
+            <a href="" id="collection_icon_fb" target="_blank"><img src="/img/icon_fb@2x.png" alt=""></a>
+            <a href="" id="collection_icon_line" target="_blank"><img src="/img/icon_line@2x.png" alt=""></a>
+        </div>
         </div>
         <span class="line"></span>
         <p>{{ .Params.introduction | safeHTML }}</p>

+ 1 - 1
layouts/frequently_asked_questions/single.html

@@ -14,7 +14,7 @@
   </section>
 
   <div class="reserve">
-    <a href="">
+    <a href="https://ocard.co/q?s=mV8ggl&qtk=LmybMx&_ga=2.252447817.1761930027.1658133789-1993023897.1656902976">
       <img src="/img/home/線上預約icon.png" alt="">
     </a>
   </div>

+ 3 - 3
layouts/store/store.html

@@ -20,7 +20,7 @@
           可服務地區
         </div>
         <div class="store_cta_text mt-15">
-          <p>立即<a href="">預約諮詢</a></p>
+          <p>立即<a href="https://ocard.co/q?s=mV8ggl&qtk=LmybMx&_ga=2.252447817.1761930027.1658133789-1993023897.1656902976">預約諮詢</a></p>
         </div>
       </div>
       <div class="d-flex justify-content-end store_cta_box">
@@ -224,12 +224,12 @@
     <div class="style_house_sec06">
       <div class="row px-0 mx-0">
         <div class="col-6 col-md-6 ps-0">
-          <a href="./room_planner.html">
+          <a href="/room_planner/">
             <img class="img-fluid" src="/img/service planner.png" alt="">
           </a>
         </div>
         <div class="col-6 col-md-6 pe-0">
-          <a href="./frequently_asked_questions.html">
+          <a href="/frequently_asked_questions/">
             <img class="img-fluid" src="/img/qa.png" alt="">
           </a>
         </div>

+ 1 - 1
themes/hugo-universal-theme-master/layouts/frequently_asked_questions/frequently_asked_questions.html

@@ -15,7 +15,7 @@
   </section>
 
   <div class="reserve">
-    <a href="">
+    <a href="https://ocard.co/q?s=mV8ggl&qtk=LmybMx&_ga=2.252447817.1761930027.1658133789-1993023897.1656902976">
       <img src="/img/home/線上預約icon.png" alt="">
     </a>
   </div>

+ 1 - 1
themes/hugo-universal-theme-master/layouts/partials/features.html

@@ -54,7 +54,7 @@
   </div>
 
   <div class="reserve">
-    <a href="">
+    <a href="https://ocard.co/q?s=mV8ggl&qtk=LmybMx&_ga=2.252447817.1761930027.1658133789-1993023897.1656902976">
       <img src="img/home/線上預約icon.png" alt="">
     </a>
   </div>

+ 18 - 18
themes/hugo-universal-theme-master/layouts/partials/footer.html

@@ -4,7 +4,7 @@
       <div class="col">
         <div class="d-flex flex-column">
           <h5 class="title">
-            <a href="">關於小寶優居</a>
+            關於小寶優居
           </h5>
           <ul>
             <li>
@@ -22,14 +22,14 @@
           </ul>
 
           <h5 class="title">
-            <a href="">社群平台</a>
+            社群平台
           </h5>
           <ul>
             <li>
-              <a href="">Facebook</a>
+              <a href="https://www.facebook.com/bhouse.tw/" target="_blank">Facebook</a>
             </li>
             <li>
-              <a href="">Youtube</a>
+              <a href="https://www.youtube.com/channel/UCOYvhrSCu6DRbLWNoy6lDTg/videos?view=0" target="_blank">Youtube</a>
             </li>
           </ul>
         </div>
@@ -38,7 +38,7 @@
       <div class="col">
         <div class="d-flex flex-column">
           <h5 class="title">
-            <a href="/room_planner/">成家設計服務</a>
+            成家設計服務
           </h5>
           <ul>
             <li>
@@ -50,18 +50,18 @@
           </ul>
 
           <h5 class="title">
-            <a href="/store/">小寶優居門市</a>
+            小寶優居門市
           </h5>
           <ul>
             <li>
-              <a href="">服務範圍</a>
+              <a href="/store/">服務範圍</a>
             </li>
             <li>
               <a href="">新北門市</a>
             </li>
-            <li>
+            <!-- <li>
               <a href="">桃園門市</a>
-            </li>
+            </li> -->
             <li>
               <a href="">台中門市</a>
             </li>
@@ -75,32 +75,32 @@
       <div class="col">
         <div class="d-flex flex-column">
           <h5 class="title">
-            <a href="/collection/">成家故事作品集</a>
+            成家故事作品集
           </h5>
           <ul>
             <li>
-              <a href="">透天設計</a>
+              <a href="/collection/">透天設計</a>
             </li>
             <li>
-              <a href="">大樓設計</a>
+              <a href="/collection/">大樓設計</a>
             </li>
           </ul>
 
           <h5 class="title">
-            <a href="/furniture_design/">小寶設計單品</a>
+            小寶設計單品
           </h5>
           <ul>
             <li>
-              <a href="">所有設計單品</a>
+              <a href="/furniture_design/sofa/">所有設計單品</a>
             </li>
             <li>
-              <a href="">關於系統櫃</a>
+              <a href="/system_furniture/">關於系統櫃</a>
             </li>
             <li>
-              <a href="">關於實木家具</a>
+              <a href="/solid_wood_furniture/">關於實木家具</a>
             </li>
             <li>
-              <a href="">關於床墊</a>
+              <a href="/about_mattress/">關於床墊</a>
             </li>
           </ul>
         </div>
@@ -108,7 +108,7 @@
 
       <div class="col">
         <h5 class="title">
-          <a href="/blog/">成家知識專欄</a>
+          成家知識專欄
         </h5>
         <ul>
           <li>

+ 5 - 1
themes/hugo-universal-theme-master/static/css/style.bhouse.css

@@ -185,6 +185,10 @@ img {
   display: none !important;
 }
 
+.blog_loading {
+  display: none !important;
+}
+
 @-webkit-keyframes star {
   from {
     -webkit-transform: scale(1);
@@ -471,7 +475,7 @@ img {
   padding: 5px 0;
 }
 
-.footer .title a {
+.footer .title {
   font-size: 15px;
   color: var(--main-color);
   font-family: NSJP-500;

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 2
themes/hugo-universal-theme-master/static/css/style.bhouse.css.map


+ 5 - 1
themes/hugo-universal-theme-master/static/css/style.bhouse.scss

@@ -189,6 +189,10 @@ img {
   display: none !important;
 }
 
+.blog_loading {
+  display: none !important;
+}
+
 @keyframes star {
   from {
     transform: scale(1);
@@ -447,7 +451,7 @@ img {
   padding: 5px 0;
 }
 
-.footer .title a {
+.footer .title {
   font-size: 15px;
   color: var(--main-color);
   font-family: NSJP-500;

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor