head.html 5.8 KB

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