layouts/partials/head.html (77 lines of code) (raw):

{{- $isBlogPost := eq .Section "blog" }} {{- $ogType := cond (.IsHome) "website" "article" }} <!-- per-page robot indexing controls --> {{- if hugo.IsProduction -}} <meta name="ROBOTS" content="INDEX, FOLLOW"> {{- else -}} <meta name="ROBOTS" content="NOINDEX, NOFOLLOW"> {{- end -}} <!-- alternative translations --> {{ range .Translations -}} <link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}"> {{ end -}} {{ if .Params.canonicalUrl }} <link rel="canonical" href="{{ .Params.canonicalUrl }}"> {{ else }} <link rel="canonical" href="{{ .Permalink }}"> {{ end }} {{ if $.Site.Params.cn_site }} <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?3b78f49ba47181e4d998a66b689446e9"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> {{ end }} <!-- Docsy head.html begins here --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> {{ hugo.Generator }} {{ range .AlternativeOutputFormats -}} <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> {{ end -}} {{ partialCached "favicons.html" . }} <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title> {{- template "_internal/opengraph.html" . -}} {{- template "_internal/schema.html" . -}} {{- template "_internal/twitter_cards.html" . -}} {{- if hugo.IsProduction -}} {{ template "_internal/google_analytics.html" . }} {{ end }} {{ partialCached "head-css.html" . "asdf" }} <script src="/js/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> {{ if and (.Site.Params.offlineSearch) (not .Site.Params.gcs_engine_id) }} <script src="/js/lunr.min.js" integrity="sha384-vRQ9bDyE0Wnu+lMfm57BlYLO0/XauFuKpVsZPs7KEDwYKktWi5+Kz3MP8++DFlRY" crossorigin="anonymous"></script> <script src="/js/offline-search.js"></script> {{end}} {{ partial "hooks/head-end.html" . }} <!-- Docsy head.html ends here --> <meta name="theme-color" content="#326ce5"> {{ partial "css.html" . }} <!-- Content for social media sharing previews --> <!-- Facebook uses the og: stuff, while Twitter and others use twitter: --> <meta name="description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Summary }}{{ end }}"> <meta property="og:description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Summary }}{{ end }}"> <meta name="twitter:description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Summary }}{{ end }}"> <meta property="og:url" content="{{ .Permalink }}"> <meta property="og:title" content="{{ if .Params.title }}{{ .Title }}{{ else }}{{ .Summary | truncate 10 }}{{ end }}"> <meta name="twitter:title" content="{{ if .Params.title }}{{ .Title }}{{ else }}{{ .Summary | truncate 10 }}{{ end }}"> <!-- Alt text for the site image --> <meta name="twitter:image:alt" content="{{ site.Title }}"> {{ if $isBlogPost }} {{ with findRE "<img.*?>" .Content 1 }} <meta property="og:image" content="{{ index . 0 | replaceRE ".*src=\"(.+?)\".*" "$1" }}"> {{ end }} {{ else }} {{ end }} <meta property="og:type" content="{{ $ogType }}"> <meta name="viewport" content="width=device-width"> <!-- Place this tag in your head or just before your close body tag. --> <script async defer src="/js/github-buttons.js"></script> <link href="/css/community.css" rel="stylesheet"> <link href="/css/contactus.css" rel="stylesheet"> <link href="/css/language.css" rel="stylesheet"> <!--<script defer src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>--> <script src="{{ "js/script.js" | relURL }}"></script> {{ with .Params.js }}{{ range (split . ",") }}<script src="{{ (trim . " ") | relURL }}"></script><!-- custom js added --> {{ end }}{{ else }}<!-- no custom js detected -->{{ end }}