head.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {{/* cSpell:ignore docsearch opengraph outputformat */ -}}
  2. <meta charset="utf-8">
  3. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  4. {{ range .AlternativeOutputFormats -}}
  5. <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
  6. {{ end -}}
  7. {{ $outputFormat := partial "outputformat.html" . -}}
  8. {{ if and hugo.IsProduction (ne $outputFormat "print") -}}
  9. <meta name="robots" content="index, follow">
  10. {{ else -}}
  11. <meta name="robots" content="noindex, nofollow">
  12. {{ end -}}
  13. {{ partialCached "favicons.html" . }}
  14. <title>
  15. {{- if .IsHome -}}
  16. {{ .Site.Title -}}
  17. {{ else -}}
  18. {{ with .Title }}{{ . }} | {{ end -}}
  19. {{ .Site.Title -}}
  20. {{ end -}}
  21. </title>
  22. <meta name="description" content="{{ partial "page-description.html" . }}">
  23. {{ partial "opengraph.html" . -}}
  24. {{ partial "schema.html" . -}}
  25. {{ partial "twitter_cards.html" . -}}
  26. {{ partialCached "head-css.html" . "head-css-cache-key" -}}
  27. <script
  28. src="https://code.jquery.com/jquery-3.7.1.min.js"
  29. integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
  30. crossorigin="anonymous"></script>
  31. {{ if .Site.Params.offlineSearch -}}
  32. <script defer
  33. src="https://unpkg.com/lunr@2.3.9/lunr.min.js"
  34. integrity="sha384-203J0SNzyqHby3iU6hzvzltrWi/M41wOP5Gu+BiJMz5nwKykbkUx8Kp7iti0Lpli"
  35. crossorigin="anonymous"></script>
  36. {{ end -}}
  37. {{ if .Site.Params.prism_syntax_highlighting -}}
  38. <link rel="stylesheet" href="{{ "css/prism.css" | relURL }}"/>
  39. {{ end -}}
  40. {{ template "algolia/head" . -}}
  41. {{ partial "hooks/head-end.html" . -}}
  42. {{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}}
  43. {{ if hugo.IsProduction -}}
  44. {{ partial "google_analytics.html" . -}}
  45. {{ end -}}
  46. {{ define "algolia/head" -}}
  47. {{ if and .Site.Params.search (isset .Site.Params.search "algolia") -}}
  48. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3.8.2"
  49. integrity="sha512-l7pkV1dOURFyHCeH8I4fK9lCkQKuqhlsTCqRl3zktifDlB8oTUJ+mJPgYkK9kHpUut8j1iPquTv32t6hvTPv3g=="
  50. crossorigin="anonymous" />
  51. {{ end -}}
  52. {{ if ne .Site.Params.algolia_docsearch nil -}}
  53. {{ warnf `Config 'params.algolia_docsearch' is deprecated: use 'params.search.algolia'
  54. For details, see https://www.docsy.dev/docs/adding-content/search/#algolia-docsearch.` -}}
  55. {{ end -}}
  56. {{ end -}}