headers.html 5.8 KB

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