headers.html 6.2 KB

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