You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
131 lines
5.0 KiB
131 lines
5.0 KiB
<head>
|
|
<title>{{.Title}}</title>
|
|
<meta charset="utf-8">
|
|
|
|
<!--
|
|
-- Package all CSS files together and minify them.
|
|
-- The page loading time should improve.
|
|
-->
|
|
{{ $chroma := resources.Get "css/chroma.css" }}
|
|
{{ $itix := resources.Get "css/itix.css" }}
|
|
{{ $css := slice $chroma $itix | resources.Concat "css/itix.css" | resources.Minify | resources.Fingerprint "sha512" }}
|
|
<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
|
|
|
|
<!--
|
|
-- Core Web Vitals / Cumulative Layout Shift.
|
|
--
|
|
-- Preload all fonts and images to reduce layout shifts.
|
|
-->
|
|
<link rel="preload" href="/fonts/JetBrainsMono-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
<link rel="preload" href="/fonts/JetBrainsMono-Regular.woff" as="font" type="font/woff" crossorigin="anonymous">
|
|
<link rel="preload" href="/fonts/JetBrainsMono-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous">
|
|
<link rel="preload" href="/fonts/SourceSerifPro-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous">
|
|
<link rel="preload" href="/fonts/SourceSansPro-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous">
|
|
|
|
<!--
|
|
-- Ensure the <meta name=description> tag is never empty since it is used
|
|
-- in the SEO score.
|
|
-->
|
|
{{- if .IsHome }}
|
|
{{- with .Site.Params.description }}
|
|
<meta name="description" content="{{ . }}">
|
|
{{- else }}
|
|
<meta name="description" content="{{ .Title }}">
|
|
{{- end }}
|
|
{{- else }}
|
|
{{- with .Params.description }}
|
|
<meta name="description" content="{{ . }}">
|
|
{{- else }}
|
|
<meta name="description" content="{{ .Title }}">
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
<!-- Tell IE to use the Edge engine -->
|
|
<meta name="X-UA-Compatible" content="IE=edge">
|
|
|
|
<!--
|
|
-- The viewport is the user's visible area of a web page.
|
|
-- The viewport varies with the device, and will be smaller on a mobile phone
|
|
-- than on a computer screen.
|
|
--
|
|
-- This meta tag let web designers take control over the viewport.
|
|
--
|
|
-- The width property controls the size of the viewport. It can be set to
|
|
-- the special value device-width, which is the width of the screen in CSS
|
|
-- pixels at a scale of 100%.
|
|
--
|
|
-- The initial-scale=1.0 part sets the initial zoom level when the page
|
|
-- is first loaded by the browser.
|
|
-->
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
{{ template "_internal/opengraph.html" . }}
|
|
{{ template "_internal/twitter_cards.html" . }}
|
|
|
|
<!-- The search page is the only one to require Javascript -->
|
|
{{ if eq .Type "search" }}
|
|
<!--
|
|
-- Download and copy over fuse.js file from fusejs.io.
|
|
-- I used the UMD build, minified, version 6.4.3
|
|
-->
|
|
<script src="/js/fuse.js"></script>
|
|
{{ end }}
|
|
|
|
{{- if .Params.enableMathJax -}}
|
|
{{- partial "mathjax.html" . -}}
|
|
{{- end -}}
|
|
|
|
<!-- Deal with the case of english articles published in the french site -->
|
|
{{- partial "lang-detection.html" . -}}
|
|
{{- if .IsTranslated -}}
|
|
{{- range .Translations -}}
|
|
{{- if .Scratch.Get "en_article_in_fr_site" -}}
|
|
<!--
|
|
-- It's an english article published in the french site
|
|
-- Tell Google not to index it and link to the original article.
|
|
--
|
|
-- See https://developers.google.com/search/docs/advanced/crawling/consolidate-duplicate-urls
|
|
-->
|
|
<link rel="canonical" href="{{ .Permalink }}">
|
|
<meta name="robots" content="noindex">
|
|
{{ else }}
|
|
<!-- Otherwise, just link to the available translations, if any. -->
|
|
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}">
|
|
{{ end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
<!--
|
|
-- Structured Data can be tested using the Google Search Console.
|
|
-- https://search.google.com/test/rich-results
|
|
-->
|
|
{{- if .IsHome -}}
|
|
{{- $.Scratch.Set "structured_data" (dict "@context" "http://schema.org" "@type" "WebSite" "name" .Site.Title "url" .Site.BaseURL) -}}
|
|
{{- with .Site.Params.subtitle -}}
|
|
{{- $.Scratch.SetInMap "structured_data" "description" . -}}
|
|
{{- end -}}
|
|
{{- else if and .IsPage (eq .Section "blog") -}}
|
|
{{- $.Scratch.Set "structured_data" (dict "@context" "http://schema.org" "@type" "BlogPosting" "headline" .Title "image" (slice) "articleSection" .Section) -}}
|
|
{{- if and (eq .Lang "fr") (.Scratch.Get "en_article_in_fr_site") -}}
|
|
{{- $.Scratch.SetInMap "structured_data" "inLanguage" "en" -}}
|
|
{{- range first 1 .Translations -}}
|
|
{{- $.Scratch.SetInMap "structured_data" "mainEntityOfPage" (dict "@type" "WebPage" "@id" .Permalink) -}}
|
|
{{- end -}}
|
|
{{- else -}}
|
|
{{- $.Scratch.SetInMap "structured_data" "inLanguage" .Language.Lang -}}
|
|
{{- $.Scratch.SetInMap "structured_data" "mainEntityOfPage" (dict "@type" "WebPage" "@id" .Permalink) -}}
|
|
{{- end -}}
|
|
{{- if not .PublishDate.IsZero -}}
|
|
{{- $.Scratch.SetInMap "structured_data" "datePublished" .PublishDate -}}
|
|
{{- end -}}
|
|
{{- if and (not .Lastmod.IsZero) (ne .Lastmod .PublishDate) -}}
|
|
{{- $.Scratch.SetInMap "structured_data" "dateModified" .Lastmod -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- with $.Scratch.Get "structured_data" }}
|
|
<script type="application/ld+json">
|
|
{{- . | jsonify | safeJS -}}
|
|
</script>
|
|
{{- end }}
|
|
|
|
</head>
|
|
|