headers.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. {{if or (eq .Type "collection") (eq .Type "blog") (eq .Type "news") }}
  6. <title>{{ .Params.meta_title }}</title>
  7. {{ else }}
  8. {{ $title_plain := .Title | markdownify | plainify }}
  9. <title>{{ $title_plain }}</title>
  10. {{ end }}
  11. <meta name="author" content="{{ .Param "author" }}" />
  12. <meta name="keywords" content="{{ .Site.Params.keywords }}" />
  13. {{if or (eq .Type "collection") (eq .Type "blog") (eq .Type "news") }}
  14. <meta name="description" content="{{ .Params.meta_description }}">
  15. {{ else }}
  16. {{ $description_plain := default .Site.Params.defaultDescription .Description | markdownify | plainify }}
  17. <meta name="description" content="{{ $description_plain }}">
  18. {{ end }}
  19. <!-- Google Tag Manager -->
  20. <script>(function (w, d, s, l, i) {
  21. w[l] = w[l] || []; w[l].push({
  22. 'gtm.start':
  23. new Date().getTime(), event: 'gtm.js'
  24. }); var f = d.getElementsByTagName(s)[0],
  25. j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
  26. 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
  27. })(window, document, 'script', 'dataLayer', 'GTM-TTKNPPT');</script>
  28. <!-- End Google Tag Manager -->
  29. {{ hugo.Generator }}
  30. <!-- Font -->
  31. <link rel="preconnect" href="https://fonts.googleapis.com">
  32. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  33. <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100;300;400;500;700;900&display=swap" rel="stylesheet">
  34. <!-- <link href='//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,700,800' rel='stylesheet' type='text/css'> -->
  35. <!-- Bootstrap and Font Awesome CSS -->
  36. <link rel="stylesheet" href="//use.fontawesome.com/releases/v5.11.2/css/all.css">
  37. <!-- <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> -->
  38. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
  39. <!-- AOS -->
  40. <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
  41. <!-- CSS animations -->
  42. <link href="{{ "css/animate.css" | relURL }}" rel="stylesheet">
  43. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.css">
  44. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.css">
  45. <!-- Theme stylesheet, if possible do not edit this stylesheet -->
  46. {{ with .Site.Params.style }}
  47. <link href="{{ "css/style" | relURL }}.{{ . }}.css" rel="stylesheet" id="theme-stylesheet">
  48. {{ else }}
  49. <link href="{{ "css/style.bhouse.css" | relURL }}" rel="stylesheet" id="theme-stylesheet">
  50. {{ end }}
  51. <!-- Custom stylesheet - for your changes -->
  52. <link href="{{ "css/custom.css" | relURL }}?{{ now.Unix }}" rel="stylesheet">
  53. <!-- Responsivity for older IE -->
  54. {{ `
  55. <!--[if lt IE 9]>
  56. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  57. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  58. <![endif]-->
  59. ` | safeHTML }}
  60. <!-- Favicon and Apple touch icons-->
  61. <link rel="icon" type="image/x-icon" href="/img/logo.png">
  62. <meta name="apple-mobile-web-app-capable" content="yes">
  63. <link rel="apple-touch-icon" sizes="120x120" href="/img/logo.png" />
  64. <!-- owl carousel CSS -->
  65. <link href="{{ "css/owl.carousel.css" | relURL }}" rel="stylesheet">
  66. <link href="{{ "css/owl.theme.css" | relURL }}" rel="stylesheet">
  67. <!-- RSS feed -->
  68. <link rel="alternate" href="{{ "/index.xml" | absURL }}" type="application/rss+xml" title="{{ .Site.Title }}">
  69. <!-- Facebook OpenGraph tags -->
  70. {{ $is_blog := and (eq .Type "blog") (eq .Kind "page") }}
  71. {{ $has_image := isset .Params "banner" }}
  72. {{ $image := cond $has_image .Params.banner (.Site.Params.default_sharing_image | default "img/sharing-default.png") }}
  73. {{ $is_valid_image := print "static/" $image | fileExists }}
  74. {{ if $is_valid_image }}
  75. {{ $image_ext := path.Ext $image }}
  76. <meta property="og:locale" content="{{ replace .Site.LanguageCode "-" "_" }}">
  77. <meta property="og:site_name" content="{{ .Site.Title }}">
  78. <meta property="og:title" content="{{ .Params.title }}">
  79. <meta property="og:type" content="{{ cond $is_blog "article" "website" }}">
  80. <meta property="og:url" content="{{ .Permalink }}" />
  81. {{ if or (eq .Type "collection") }}
  82. <meta property="og:description" content="{{ .Params.meta_description }}">
  83. {{ else }}
  84. <meta property="og:description" content="{{ .Site.Params.description }}">
  85. {{ end }}
  86. <meta property="og:image" content="{{ $image | absURL }}">
  87. <meta property="og:image:type" content="image/{{ if eq $image_ext ".svg" }}svg+xml{{ else }}{{ trim $image_ext "." }}{{ end }}">
  88. {{ with .Params.banner_alt }}<meta property="og:image:alt" content="{{ . | markdownify | plainify }}">{{ end }}
  89. {{ $image_local := printf "/static/%s" $image}}
  90. {{ with (imageConfig $image_local) }}
  91. <meta property="og:image:width" content="{{ .Width }}">
  92. <meta property="og:image:height" content="{{ .Height }}">
  93. {{ end }}
  94. {{ end }}
  95. {{ with .Lastmod }}<meta property="og:updated_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
  96. {{ if $is_blog }}
  97. {{ with .Param "facebook_site" }}<meta property="article:publisher" content="https://www.facebook.com/{{ . }}/">{{ end }}
  98. {{ with .Param "facebook_author" }}<meta property="article:author" content="https://www.facebook.com/{{ . }}/">{{ end }}
  99. {{ with .Params.categories }}<meta property="article:section" content="{{ index . 0 }}">{{ end }}
  100. {{ range .Params.tags }}<meta property="article:tag" content="{{ . }}">
  101. {{ end }}
  102. {{ if gt .ExpiryDate .PublishDate }}<meta property="article:expiration_time" content="{{ .ExpiryDate.Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
  103. {{ with .PublishDate }}<meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
  104. {{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format "2006-01-02T15:04:05Z0700" }}">{{ end }}
  105. {{ end }}
  106. <!-- Twitter Card meta tags -->
  107. <meta name="twitter:card" content="summary{{ if (and $is_blog (and $has_image $is_valid_image)) }}_large_image{{ end }}">
  108. {{ with .Param "twitter_site" }}<meta name="twitter:site" content="@{{ . }}">{{ end }}
  109. <meta name="twitter:title" content="{{ .Params.title| truncate 70 }}">
  110. {{ if $is_valid_image }}
  111. <meta name="twitter:image" content="{{ $image | absURL }}">
  112. {{ end }}
  113. <meta name="twitter:description" content="{{ .Site.Params.description| truncate 200 }}">
  114. {{ with .Param "twitter_author" }}<meta name="twitter:creator" content="@{{ . }}">{{ end }}