SyuanYu 2 lat temu
rodzic
commit
7a045fd434

+ 1 - 1
config.toml

@@ -1,4 +1,4 @@
-baseURL = 'http://example.org/'
+baseURL = 'https://bhouse.com.tw/'
 languageCode = 'en-us'
 title = '小寶優居・美好成家:陪伴你成家的住宅設計品牌'
 theme = 'hugo-universal-theme-master'

+ 68 - 59
layouts/blog/list.html

@@ -139,9 +139,10 @@
         // 網址有參數
         if (tagsVal !== null) {
           contentsData.map(item => {
-            if (item.blog_tag) {
-              if (item.blog_tag.includes(tagsVal)) {
-                matchContent += `
+            if (item.draft !== "true") {
+              if (item.blog_tag) {
+                if (item.blog_tag.includes(tagsVal)) {
+                  matchContent += `
                 <div class="article-item">
                   <a href="${item.url}?tags=${tagsVal}">
                     <img src="${item.image}" alt="">
@@ -156,71 +157,77 @@
                     </a>
                   </div>
                 </div>`
+                }
               }
             }
           })
         } else if (url.pathname === '/blog/') {
           contentsData.map(item => {
-            // 排除根目錄
-            if (item.url !== "/blog") {
-              matchContent += `
-            <div class="article-item">
-              <a href="${item.url}">
-                <img src="${item.image}" alt="">
-              </a>
-              <div class="d-flex flex-column">
+            if (item.draft !== "true") {
+              // 排除根目錄
+              if (item.url !== "/blog") {
+                matchContent += `
+              <div class="article-item">
                 <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>
+                  <img src="${item.image}" alt="">
                 </a>
-              </div>
-            </div>`
+                <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>`
+              }
             }
           }
           )
         } else {
           // 網址沒有參數
           contentsData.map(item => {
-            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="">
-              </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>`
+            if (item.draft !== "true") {
+              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="">
+                  </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>`
+                  }
                 }
-              }
-            } else {
-              matchContent += `
-            <div class="article-item">
-              <a href="${item.url}">
-                <img src="${item.image}" alt="">
-              </a>
-              <div class="d-flex flex-column">
+              } else {
+                matchContent += `
+              <div class="article-item">
                 <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>
+                  <img src="${item.image}" alt="">
                 </a>
-              </div>
-            </div>`
+                <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>`
+              }
             }
+
           })
         }
 
@@ -250,9 +257,10 @@
           // if (item.categories) {
           //   if (item.categories.includes(category)) {
           // 搜尋所有分類文章
-          if (item.url !== '/blog') {
-            if (item.title.includes(inputVal) || item.description.includes(inputVal) || item.content.includes(inputVal)) {
-              matchContent += `
+          if (item.draft !== "true") {
+            if (item.url !== '/blog') {
+              if (item.title.includes(inputVal) || item.description.includes(inputVal) || item.content.includes(inputVal)) {
+                matchContent += `
                 <div class="article-item">
                   <a href="${item.url}">
                     <img src="${item.image}" alt="">
@@ -267,12 +275,12 @@
                     </a>
                   </div>
                 </div>`
-            } else {
-              falseItem.push(item);
-            }
+              } else {
+                falseItem.push(item);
+              }
 
-            if (falseItem.length === contentsData.length - 1) {
-              matchContent = `
+              if (falseItem.length === contentsData.length - 1) {
+                matchContent = `
             <div class="alert d-flex align-items-center" role="alert" style="max-width: 300px;margin: 0 auto 25px;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"/>
@@ -282,6 +290,7 @@
               </div>
             </div>
             `;
+              }
             }
           }
           //   }

+ 1 - 1
layouts/blog/single.html

@@ -75,7 +75,7 @@
   (function getContentsData() {
     // 線上版網址 https://bhouse3.ptt.cx:9002/api/
     // 本地端網址 http://localhost:9001/api/
-    fetch('http://localhost:9001/api/contents?url=/blog').then(res => res.json()).then(list => {
+    fetch('https://bhouse3.ptt.cx:9002/api/contents?url=/blog').then(res => res.json()).then(list => {
       let title = document.querySelector('h1').innerHTML;
       let lnkList = [];
 

+ 52 - 45
themes/hugo-universal-theme-master/layouts/_default/taxonomy.html

@@ -160,11 +160,13 @@
       // 分類篩選
       function filterCategory() {
         // 網址有參數
+        console.log('filterCategory');
         if (tagsVal !== null) {
           contentsData.map(item => {
-            if (item.blog_tag) {
-              if (item.blog_tag.includes(tagsVal)) {
-                matchContent += `
+            if (item.draft !== "true") {
+              if (item.blog_tag) {
+                if (item.blog_tag.includes(tagsVal)) {
+                  matchContent += `
                 <div class="article-item">
                   <a href="${item.url}?tags=${tagsVal}">
                     <img src="${item.image}" alt="">
@@ -179,47 +181,50 @@
                     </a>
                   </div>
                 </div>`
+                }
               }
             }
           })
         } else {
           contentsData.map(item => {
-            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="">
-              </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>`
+            if (item.draft !== "true") {
+              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="">
+                      </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>`
+                  }
                 }
+              } 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>`
               }
-            } 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>`
             }
           })
         }
@@ -290,9 +295,10 @@
           // if (item.categories) {
           //   if (item.categories.includes(category)) {
           // 搜尋所有分類文章
-          if (item.url !== '/blog') {
-            if (item.title.includes(inputVal) || item.description.includes(inputVal) || item.content.includes(inputVal)) {
-              matchContent += `
+          if (item.draft !== "true") {
+            if (item.url !== '/blog') {
+              if (item.title.includes(inputVal) || item.description.includes(inputVal) || item.content.includes(inputVal)) {
+                matchContent += `
                 <div class="article-item">
                   <a href="${item.url}">
                     <img src="${item.image}" alt="">
@@ -307,12 +313,12 @@
                     </a>
                   </div>
                 </div>`
-            } else {
-              falseItem.push(item);
-            }
+              } else {
+                falseItem.push(item);
+              }
 
-            if (falseItem.length === contentsData.length - 1) {
-              matchContent = `
+              if (falseItem.length === contentsData.length - 1) {
+                matchContent = `
             <div class="alert d-flex align-items-center" role="alert" style="max-width: 300px;margin: 0 auto 25px;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"/>
@@ -322,6 +328,7 @@
               </div>
             </div>
             `;
+              }
             }
           }
           //   }

+ 19 - 27
themes/hugo-universal-theme-master/layouts/index.html

@@ -21,35 +21,27 @@
 
   {{ partial "scripts.html" . }}
 
-  <!-- <script>
-    (function getContentsData() {
-      // 線上版網址 https://bhouse3.ptt.cx:9002/api/
-      // 本地端網址 http://localhost:9001/api/
-      fetch('https://bhouse3.ptt.cx:9002/api/contents?url=/collection').then(res => res.json()).then(list => {
-        let collectionContent = document.querySelector('.collection-content');
-        let collectionList = [];
-
-        for (let i = 0; i < 3; i++) {
-          const e = list[i];
-
-          let content = `
-          <div class="col-12 p-0 bottom-box">
-            <a style="text-decoration: none;" href="${e.url}">
-              <img src="${e.image}" style="max-width: 100%;">
-              <div>
-                <p>${e.banner_img_text}</p>
-                <p>${e.homeowner}|${e.room_count}|${e.house_size}</p>
-              </div>
-            </a>
-          </div>`;
-
-          collectionList.push(content);
+
+  <script>
+    // 暫時隱藏首頁第一篇作品(因文案尚未確定)
+    // let bottomBox = document.querySelector('.bottom-box');
+    // bottomBox.style.display = "none"
+
+    window.onload = () => {
+      // 取得圖片尺寸
+      let collectionImg = document.querySelectorAll('.collection-content img');
+      for (let index = 0; index < collectionImg.length; index++) {
+        const element = collectionImg[index];
+        // 若圖片失效則隱藏
+        if (element.naturalHeight < 50) {
+          console.log('圖片失效', element);
+          let parent = element.parentNode.parentNode;
+          parent.style.display = "none";
         }
-        collectionContent.innerHTML = collectionList.join(" ");
-      })
-    })();
-  </script> -->
+      }
+    }
 
+  </script>
 </body>
 
 </html>

+ 0 - 5
themes/hugo-universal-theme-master/layouts/partials/carousel.html

@@ -9,11 +9,6 @@
     <div class="slider-item">
       <img src="./img/home/head.png" alt="" class="img-fluid">
     </div>
-    <div class="slider-item">
-      <a href="https://maac.io/1QYHI">
-        <img src="./img/home/cafe.png" alt="" class="img-fluid cafe-img">
-      </a>
-    </div>
     <!-- LINE@ 暫時關閉 -->
     <!-- <div class="slider-item">
       <a href="https://maac.io/1Qcnm" target="_blank">

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

@@ -14,7 +14,7 @@
               <a href="/news/">最新消息公告</a>
             </li>
             <li>
-              <a href="mailto:agnes.chen@bhouse.com.tw,jade.wang@bhouse.com.tw">媒體聯繫</a>
+              <a href="mailto:christine.tang@bhouse.com.tw,jade.wang@bhouse.com.tw">媒體聯繫</a>
             </li>
             <li>
               <a target="_blank" href="https://www.104.com.tw/company/1a2x6bk01k">人才招募</a>
@@ -270,7 +270,7 @@
                 <a href="/news/">最新消息公告</a>
               </li>
               <li>
-                <a href="mailto:agnes.chen@bhouse.com.tw,jade.wang@bhouse.com.tw">媒體聯繫</a>
+                <a href="mailto:christine.tang@bhouse.com.tw,jade.wang@bhouse.com.tw">媒體聯繫</a>
               </li>
               <li>
                 <a target="_blank" href="https://www.104.com.tw/company/1a2x6bk01k">人才招募</a>

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

@@ -81,6 +81,7 @@
 
 <!-- RSS feed -->
 <link rel="alternate" href="{{ "/index.xml" | absURL }}" type="application/rss+xml" title="{{ .Site.Title }}">
+<link rel="canonical" href="{{ .Permalink }}" />
 
 <!-- Facebook OpenGraph tags -->
 {{ $is_blog := and (eq .Type "blog") (eq .Kind "page") }}

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

@@ -434,7 +434,7 @@ button {
 }
 .slider-item img {
   width: 100%;
-  height: 44vw;
+  height: 845px;
   -o-object-fit: cover;
   object-fit: cover;
 }
@@ -448,16 +448,6 @@ button {
     height: 335px;
   }
 }
-.slider-item .cafe-img {
-  -o-object-position: 0 80%;
-     object-position: 0 80%;
-}
-@media (max-width: 991px) {
-  .slider-item .cafe-img {
-    -o-object-position: center;
-       object-position: center;
-  }
-}
 
 .slider-item div {
   padding: 20px 18vw;

Plik diff jest za duży
+ 0 - 0
themes/hugo-universal-theme-master/static/css/style.bhouse.css.map


+ 0 - 6
themes/hugo-universal-theme-master/static/css/style.bhouse.scss

@@ -463,12 +463,6 @@ button {
       height: 335px;
     }
   }
-  // .cafe-img {
-  //   object-position: 0 80%;
-  //   @media (max-width: 991px) {
-  //     object-position: center;
-  //   }
-  // }
 }
 
 .slider-item div {

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików