keimena/layouts/partials/head.html

67 lines
2.8 KiB
HTML
Raw Normal View History

2024-05-27 21:13:51 +00:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
--accent-color: {{ .Site.Params.AccentColor | default "#FF4D4D" }};
}
</style>
{{ $title := .Title | default .Site.Title }}
{{ $description := .Description | default .Site.Params.Description }}
{{ $image := .Params.image | default (.Scratch.Get "avatarImgSrc") }}
{{ $siteKeywords := .Site.Params.MetaKeywords | default (slice) }}
{{ $postKeywords := .Params.tags | default (slice) }}
{{ $keywords := union $siteKeywords $postKeywords }}
<!-- SEO titles & descriptions -->
{{ if .IsHome }}
<title>{{ lower .Site.Title }} | home</title>
{{else}}
<title> {{ lower .Site.Title }} | {{ lower $title}} </title>
{{ end }}
<meta name="description" content="{{ $description }}">
<meta name="keywords" content='{{ delimit $keywords ", "}}'>
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:type" content="website">
<meta property="og:title" content="{{ $title }}">
<meta property="og:description" content="{{ $description }}">
<meta property="og:image" content="{{ absURL $image }}">
<meta property="og:image:secure_url" content="{{ absURL $image }}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ $title }}">
<meta name="twitter:description" content="{{ $description }}">
<meta property="twitter:domain" content="{{ .Permalink }}">
<meta property="twitter:url" content="{{ .Permalink }}">
<meta name="twitter:image" content="{{ absURL $image }}">
<!-- GFS Didot font -->
<link href="https://fonts.googleapis.com/css2?family=GFS+Didot&display=swap" rel="stylesheet" type="text/css">
<!-- SEO canonicals: helps Google understand your site better when using marketing campaign tagging etc -->
<link rel="canonical" href="{{ .Permalink }}" />
{{ $cssNormalize := resources.Get "css/normalize.min.css" }}
<link rel="stylesheet" type="text/css" href="{{ $cssNormalize.RelPermalink }}" media="print">
{{ $cssMain := resources.Get "css/main.css" | minify }}
<link rel="stylesheet" type="text/css" href="{{ $cssMain.RelPermalink }}">
{{ $cssDark := resources.Get "css/dark.css" | minify }}
<link id="dark-theme" rel="stylesheet" href="{{ $cssDark.RelPermalink }}">
{{ $jsBundle := resources.Match "js/**.js" | resources.Concat "js/bundle.js" | minify | resources.Fingerprint "sha256" }}
<script src="{{ $jsBundle.RelPermalink }}" integrity="{{ $jsBundle.Data.Integrity }}"></script>
<!-- Option for user to inject custom html -->
{{ if .Site.Params.CustomHeadHTML }}
{{ .Site.Params.CustomHeadHTML | safeHTML }}
{{ end }}
</head>