index.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html lang="{{ .Site.LanguageCode }}">
  3. <head>
  4. {{ partial "headers.html" . }}
  5. </head>
  6. <body style="overflow-x: hidden;">
  7. <div id="all">
  8. {{ partial "nav.html" . }}
  9. {{ partial "carousel.html" . }}
  10. {{ partial "features.html" . }}
  11. {{ partial "footer.html" . }}
  12. </div>
  13. {{ partial "scripts.html" . }}
  14. <!-- <script>
  15. (function getContentsData() {
  16. // 線上版網址 https://bhouse3.ptt.cx:9002/api/
  17. // 本地端網址 http://localhost:9001/api/
  18. fetch('https://bhouse3.ptt.cx:9002/api/contents?url=/collection').then(res => res.json()).then(list => {
  19. let collectionContent = document.querySelector('.collection-content');
  20. let collectionList = [];
  21. for (let i = 0; i < 3; i++) {
  22. const e = list[i];
  23. let content = `
  24. <div class="col-12 p-0 bottom-box">
  25. <a style="text-decoration: none;" href="${e.url}">
  26. <img src="${e.image}" style="max-width: 100%;">
  27. <div>
  28. <p>${e.banner_img_text}</p>
  29. <p>${e.homeowner}|${e.room_count}|${e.house_size}</p>
  30. </div>
  31. </a>
  32. </div>`;
  33. collectionList.push(content);
  34. }
  35. collectionContent.innerHTML = collectionList.join(" ");
  36. })
  37. })();
  38. </script> -->
  39. </body>
  40. </html>