SyuanYu 2 年之前
父节点
当前提交
2ff7608122

+ 2 - 2
layouts/collection/single.html

@@ -10,8 +10,8 @@
 <section class="style_house_banner container-fluid px-0">
     <img src="{{ .Params.cover_img }}" alt="">
     <div class="collection_banner_text_box">
-        <p>{{ .Params.banner_img_text}}</p>
-        <p>{{ .Params.homeowner}}|{{ .Params.room_count}}|{{ .Params.house_size}}</p>
+        <p>{{ .Params.banner_img_text }}</p>
+        <p>{{ .Params.homeowner }}|{{ .Params.room_count }}|{{ .Params.house_size }}</p>
     </div>
 </section>
 <div class="style_house_content">

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

@@ -9,38 +9,45 @@
 
   <div id="all">
 
-    <!-- {{ partial "top.html" . }} -->
-
     {{ partial "nav.html" . }}
 
     {{ partial "carousel.html" . }}
 
     {{ partial "features.html" . }}
 
-    <!-- {{ partial "testimonials.html" . }}
-
-        {{ partial "see_more.html" . }}
-
-        {{ partial "recent_posts.html" . }}
-
-        {{ partial "clients.html" . }} -->
-
     {{ partial "footer.html" . }}
 
   </div>
-  <!-- /#all -->
 
   {{ partial "scripts.html" . }}
 
   <script>
-    // $(".responsive").slick({
-    //   dots: true,
-    //   slidesToShow: 1,
-    //   slidesToScroll: 1,
-    //   autoplay: true,
-    //   autoplaySpeed: 3000,
-    //   arrows: false,
-    // });
+    (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);
+        }
+        collectionContent.innerHTML = collectionList.join(" ");
+      })
+    })();
   </script>
 
 </body>

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

@@ -22,8 +22,8 @@
       </div>
     </div>
 
-    <div class="row g-3 home-content" style="padding: 0 8px;">
-      <div class="col-12 p-0 bottom-box">
+    <div class="row g-3 home-content collection-content" style="padding: 0 8px;">
+      <!-- <div class="col-12 p-0 bottom-box">
         <a style="text-decoration: none;" href="/collection/deep_sea_wandering">
           <img src="/img/home/collection4.webp" style="max-width: 100%;">
           <div>
@@ -49,7 +49,7 @@
             <p>台中蔡小姐|三房兩廳|30坪</p>
           </div>
         </a>
-      </div>
+      </div> -->
     </div>
   </div>
 

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

@@ -4932,6 +4932,20 @@ input[type=search]::-webkit-search-cancel-button {
   margin: 1px;
 }
 
+.blog-content .video-box {
+  position: relative;
+  width: 100%;
+  height: 0;
+  padding-bottom: 56.25%;
+}
+.blog-content .video-box iframe {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+}
+
 /* 成家知識專欄-article end */
 /* 最新消息公告-news start */
 .news-content img {

文件差异内容过多而无法显示
+ 0 - 0
themes/hugo-universal-theme-master/static/css/style.bhouse.css.map


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

@@ -4713,6 +4713,23 @@ input[type="search"]::-webkit-search-cancel-button {
   margin: 1px;
 }
 
+.blog-content {
+  .video-box {
+    position: relative;
+    width: 100%;
+    height: 0;
+    padding-bottom: 56.25%;
+  }
+
+  .video-box iframe {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+  }
+}
+
 /* 成家知識專欄-article end */
 
 /* 最新消息公告-news start */

部分文件因为文件数量过多而无法显示