headers.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <meta charset="utf-8">
  2. <meta name="robots" content="all,follow">
  3. <meta name="googlebot" content="index,follow,snippet,archive">
  4. <meta name="viewport" content="width=device-width, initial-scale=1">
  5. <meta name="google-site-verification" content="rt-gC7eueNAj27a3wIEfBwFzJr_ji27cPYIH1Onllxk" />
  6. {{if or (eq .Type "collection") (eq .Type "blog") (eq .Type "news") }}
  7. <title>{{ .Params.meta_title }}</title>
  8. {{ else }}
  9. {{ $title_plain := .Title | markdownify | plainify }}
  10. <title>{{ $title_plain }}</title>
  11. {{ end }}
  12. <meta name="author" content="{{ .Param "author" }}" />
  13. <!-- <meta name="keywords" content="{{ .Site.Params.keywords }}" /> -->
  14. {{if or (eq .Type "collection") (eq .Type "blog") (eq .Type "news") }}
  15. <meta name="description" content="{{ .Params.meta_description }}">
  16. {{ else }}
  17. {{ $description_plain := default .Site.Params.defaultDescription .Description | markdownify | plainify }}
  18. <meta name="description" content="{{ $description_plain }}">
  19. {{ end }}
  20. <!-- Google Tag Manager -->
  21. <script>(function (w, d, s, l, i) {
  22. w[l] = w[l] || []; w[l].push({
  23. 'gtm.start':
  24. new Date().getTime(), event: 'gtm.js'
  25. }); var f = d.getElementsByTagName(s)[0],
  26. j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
  27. 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
  28. })(window, document, 'script', 'dataLayer', 'GTM-TTKNPPT');</script>
  29. <!-- End Google Tag Manager -->
  30. <!-- Sitemap -->
  31. <link rel="sitemap" type="application/xml" href="https://bhouse.com.tw/sitemap.xml">
  32. {{ $is_blog := and (eq .Type "blog") (eq .Kind "page") }}
  33. {{ if $is_blog }}
  34. <!-- Google 結構化資料 -->
  35. <script type="application/ld+json">
  36. {
  37. "@context": "http://schema.org",
  38. "@type": "BreadcrumbList",
  39. "itemListElement": [{
  40. "@type": "ListItem",
  41. "position": 1,
  42. "item":"https://bhouse.com.tw/",
  43. "name": "首頁"
  44. },{ "@type": "ListItem",
  45. "position": 2,
  46. "item": "https://bhouse.com.tw/blog_main/",
  47. "name":"成家知識專欄"
  48. },{"@type": "ListItem",
  49. "position": 3,
  50. "item":"{{ .Permalink }}",
  51. "name": "{{ .Params.title }}"
  52. }]
  53. }
  54. </script>
  55. <script type="application/ld+json">
  56. {
  57. "@context": "https://schema.org",
  58. "@type": "Article",
  59. "mainEntityOfPage": {
  60. "@type": "WebPage",
  61. "@id": "{{ .Permalink }}"
  62. },
  63. "headline": "{{ .Params.title }}",
  64. "image": [
  65. "https://bhouse.com.tw{{ .Params.image | relURL }}"
  66. ],
  67. "author": {
  68. "@type": "Organization",
  69. "name": "小寶優居"
  70. },
  71. "publisher": {
  72. "@type": "Organization",
  73. "name": "小寶優居",
  74. "logo": {
  75. "@type": "ImageObject",
  76. "url": "https://bhouse.com.tw/img/home/bt_index@2x.png"
  77. }
  78. },
  79. "datePublished": "{{ .Date.Format "2006-01-02" }}",
  80. "dateModified": "{{ if .Lastmod }}{{ .Lastmod.Format "2006-01-02" }}{{ else }}{{ .Date.Format "2006-01-02" }}{{ end }}"
  81. }
  82. </script>
  83. {{ end }}
  84. {{ $is_collection := and (eq .Type "collection") (eq .Kind "page") }}
  85. {{ if $is_collection }}
  86. <!-- Google 結構化資料 -->
  87. <script type="application/ld+json">
  88. {
  89. "@context": "http://schema.org",
  90. "@type": "BreadcrumbList",
  91. "itemListElement": [{
  92. "@type": "ListItem",
  93. "position": 1,
  94. "item":"https://bhouse.com.tw/",
  95. "name": "首頁"
  96. },{ "@type": "ListItem",
  97. "position": 2,
  98. "item": "https://bhouse.com.tw/collection/",
  99. "name":"室內設計作品"
  100. },{"@type": "ListItem",
  101. "position": 3,
  102. "item":"{{ .Permalink }}",
  103. "name": "{{ .Params.title }}"
  104. }]
  105. }
  106. </script>
  107. {{ end }}
  108. {{ hugo.Generator }}
  109. <!-- Font -->
  110. <link rel="preconnect" href="https://fonts.googleapis.com">
  111. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  112. <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100;300;400;500;700;900&display=swap" rel="stylesheet">
  113. <!-- <link href='//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,700,800' rel='stylesheet' type='text/css'> -->
  114. <!-- Bootstrap and Font Awesome CSS -->
  115. <link rel="stylesheet" href="//use.fontawesome.com/releases/v5.11.2/css/all.css">
  116. <!-- <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> -->
  117. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
  118. <!-- AOS -->
  119. <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
  120. <!-- CSS animations -->
  121. <!-- <link href="{{ "css/animate.css" | relURL }}" rel="stylesheet"> -->
  122. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.css">
  123. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.css">
  124. <!-- Theme stylesheet, if possible do not edit this stylesheet -->
  125. {{ with .Site.Params.style }}
  126. <link href="{{ "css/style" | relURL }}.{{ . }}.css" rel="stylesheet" id="theme-stylesheet">
  127. {{ else }}
  128. <link href="{{ "css/style.bhouse.css" | relURL }}" rel="stylesheet" id="theme-stylesheet">
  129. {{ end }}
  130. <!-- Custom stylesheet - for your changes -->
  131. <link href="{{ "css/custom.css" | relURL }}?{{ now.Unix }}" rel="stylesheet">
  132. <!-- Responsivity for older IE -->
  133. {{ `
  134. <!--[if lt IE 9]>
  135. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  136. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  137. <![endif]-->
  138. ` | safeHTML }}
  139. <!-- Favicon and Apple touch icons-->
  140. <link rel="icon" type="image/x-icon" href="/img/logo.png">
  141. <meta name="apple-mobile-web-app-capable" content="yes">
  142. <link rel="apple-touch-icon" sizes="120x120" href="/img/logo.png" />
  143. <!-- owl carousel CSS -->
  144. <!-- <link href="{{ "css/owl.carousel.css" | relURL }}" rel="stylesheet"> -->
  145. <!-- <link href="{{ "css/owl.theme.css" | relURL }}" rel="stylesheet"> -->
  146. <!-- RSS feed -->
  147. <link rel="alternate" href="{{ "/index.xml" | absURL }}" type="application/rss+xml" title="{{ .Site.Title }}">
  148. <link rel="canonical" href="{{ .Permalink }}" />
  149. <!-- Facebook OpenGraph tags -->
  150. {{ $is_blog := and (eq .Type "blog") (eq .Kind "page") }}
  151. {{ $has_image := isset .Params "banner" }}
  152. {{ $image := cond $has_image .Params.banner (.Site.Params.default_sharing_image | default "./img/sharing-default.png") }}
  153. {{ $is_valid_image := print "static/" $image | fileExists }}
  154. {{ if $is_valid_image }}
  155. {{ $image_ext := path.Ext $image }}
  156. <meta property="og:locale" content="{{ replace .Site.LanguageCode "-" "_" }}">
  157. <meta property="og:site_name" content="{{ .Site.Title }}">
  158. <meta property="og:title" content="{{ .Params.title }}">
  159. <meta property="og:type" content="{{ cond $is_blog "article" "website" }}">
  160. <meta property="og:url" content="{{ .Permalink }}" />
  161. {{ if or (eq .Type "collection") }}
  162. <meta property="og:description" content="{{ .Params.meta_description }}">
  163. {{ else }}
  164. <meta property="og:description" content="{{ .Site.Params.description }}">
  165. {{ end }}
  166. {{ if .Params.image }}
  167. <meta property="og:image" content="https://bhouse.com.tw{{ .Params.image | relURL }}"/>
  168. {{ else }}
  169. <meta property="og:image" content="./img/sharing-default.png"/>
  170. {{ end }}
  171. {{ with .Lastmod }}<meta property="og:updated_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
  172. {{ if $is_blog }}
  173. {{ with .Param "facebook_site" }}<meta property="article:publisher" content="https://www.facebook.com/{{ . }}/">{{ end }}
  174. {{ with .Param "facebook_author" }}<meta property="article:author" content="https://www.facebook.com/{{ . }}/">{{ end }}
  175. {{ with .Params.categories }}<meta property="article:section" content="{{ index . 0 }}">{{ end }}
  176. {{ range .Params.tags }}<meta property="article:tag" content="{{ . }}">
  177. {{ end }}
  178. {{ if gt .ExpiryDate .PublishDate }}<meta property="article:expiration_time" content="{{ .ExpiryDate.Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
  179. {{ with .PublishDate }}<meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
  180. {{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
  181. {{ end }}
  182. {{ end }}