Want to contribute? Fork me on Codeberg.org!
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

96 lines
3.6 KiB

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ $title := cond .IsHome .Site.Title (printf "%s" (partial "kanji.html" .Title) | printf "%s%s" (cond (and (eq .Kind "term") (eq .Data.Singular "tag")) "#" "") | printf "%s") }}
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:title" content="{{ $title }}">
<meta name="twitter:title" content="{{ $title }}">
{{ with .Resources.GetMatch "{cover.*,*.jpg,*.png,*.jpeg}" }}
{{ with .Permalink | absURL }}
<meta property="og:image" content="{{ . }}">
<meta name="twitter:image" content="{{ . }}">
{{ end }}
{{ end }}
{{ with .Params.description }}
<meta property="og:description" content="{{ . }}">
<meta name="description" content="{{ . }}">
<meta name="twitter:description" content="{{ . }}">
{{ end }}
<meta property="og:type" content="{{ cond (eq .Kind "page") "article" "website" }}">
{{ if eq .Kind "page" }}
{{ if isset .Site.Params "soudanurl" }}
<meta name="soudan-content-id" content="{{ .RelPermalink | humanize }}">
{{ end }}
{{ with .PublishDate }}
<meta property="og:article:published_time" content="{{ partial "datestamp.html" . }}">
{{ end }}
{{ with .Lastmod }}
<meta property="og:article:modified_time" content="{{ partial "datestamp.html" . }}">
{{ end }}
{{ with .ExpiryDate }}
<meta property="og:article:expiration_time" content="{{ partial "datestamp.html" . }}">
{{ end }}
{{ with .Params.tags }}
{{ range . }}
<meta property="og:article:tag" content="{{ . }}">
{{ end }}
{{ end }}
{{ with .Site.Params.AuthorProfile }}
<meta property="og:article:author" content="{{ . }}">
{{ end }}
{{ end }}
{{ with .Site.Params.Author }}
<meta name="author" content="{{ . }}">
{{ end }}
<meta property="og:url" content="{{ .Permalink }}">
<meta name="twitter:card" content="summary">
{{ with .Site.Params.SiteTwitter }}
<meta name="twitter:site" content="@{{ . }}">
{{ end }}
{{ with .Site.Params.AuthorTwitter }}
<meta name="twitter:creator" content="@{{ . }}">
{{ end }}
{{ with .Site.Params.ThemeColor }}
<meta name="theme-color" content="{{ . }}">
{{ end }}
<link rel="stylesheet" href="/css/sakura/normalize.css">
<link rel="stylesheet" href="/css/sakura/sakura{{ if isset .Site.Params "theme" }}-{{ .Site.Params.Theme }}{{ end }}.css">
{{ if .Site.Params.Soudan }}
<link rel="stylesheet" href="/css/soudan.css">
{{ end }}
{{ if .Site.Params.Stork }}
<link rel="stylesheet" href="/css/stork.css">
<script src="/js/stork.js"></script>
<script>
stork.initialize("/js/stork.wasm");
window.onload = () => {
stork.register(
"home",
"/home.st"
);
}
</script>
{{ end }}
{{ if isset .Site.Params "matomositeid" }}
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://{{ .Site.Params.MatomoURL }}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '{{ .Site.Params.MatomoSiteId }}']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
{{ end }}
{{ if isset .Site.Params "soudanurl" }}
<script src="/js/moment.min.js"></script>
<script src="/js/markdown-it.min.js"></script>
<script>const url = "{{ .Site.Params.SoudanURL }}"</script>
{{ end }}
<title>{{ $title }}{{ if not .IsHome }} - {{ .Site.Title }}{{ end }}</title>
</head>