1
0
Fork 0
hugo-paper/layouts/partials/head.html

99 lines
2.6 KiB
HTML
Raw Normal View History

2021-08-23 21:59:02 +02:00
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
2022-11-15 01:06:02 +01:00
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
2021-08-23 21:59:02 +02:00
<!-- Title -->
<title>{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ site.Title }}</title>
<!-- Meta -->
2022-07-18 17:36:39 +02:00
<meta name="theme-color" />
2023-02-24 18:51:26 +01:00
{{ $site_author := or site.Author.name site.Params.name site.Title }}
<!---->
2021-08-23 21:59:02 +02:00
{{ if eq .Kind "page" }}
<meta name="description" content="{{ .Summary }}" />
2023-02-24 18:51:26 +01:00
<meta name="author" content="{{ or .Params.author $site_author }}" />
{{ else }}
<!---->
2022-11-15 01:06:02 +01:00
<meta
2023-02-24 18:51:26 +01:00
name="description"
content="{{ site.Params.description | default (print `A personal blog`) }}"
2022-11-15 01:06:02 +01:00
/>
2023-02-24 18:51:26 +01:00
<meta name="author" content="{{ $site_author }}" />
2021-08-23 21:59:02 +02:00
{{ end }}
<!-- Styles & Scripts -->
2023-03-14 09:43:32 +01:00
{{ $main := resources.Get "main.css" }}
2021-08-23 21:59:02 +02:00
<!---->
2023-03-14 09:43:32 +01:00
{{ $custom := resources.Get "custom.css" }}
2021-08-23 21:59:02 +02:00
<!---->
2023-03-14 09:43:32 +01:00
{{ $css := slice $main $custom | resources.Concat "main.css" | minify }}
2021-08-23 21:59:02 +02:00
<link rel="preload stylesheet" as="style" href="{{ $css.Permalink }}" />
{{ if and .IsPage (not site.Params.disableHLJS) }}
<script
defer
src="{{ `highlight.min.js` | absURL }}"
onload="hljs.initHighlightingOnLoad();"
></script>
{{ end }}
<!-- Preload -->
2022-11-15 01:06:02 +01:00
{{ $dark_icon := "theme.png" }} {{ if site.Params.monoDarkIcon }} {{
$dark_icon = "theme.svg" }} {{ end }}
2022-11-15 01:06:02 +01:00
<link rel="preload" as="image" href="{{ $dark_icon | absURL }}" />
2021-08-23 21:59:02 +02:00
2022-07-18 17:36:39 +02:00
{{ $avatar_url := $.Scratch.Get "avatar_url" }}
<!---->
{{ if $avatar_url }}
<link rel="preload" as="image" href="{{ $avatar_url }}" />
{{ end }}
<!---->
{{ range $.Scratch.Get "social_list" }}
2021-08-24 04:56:07 +02:00
<link rel="preload" as="image" href="{{ printf `%s.svg` . | absURL }}" />
2021-08-23 21:59:02 +02:00
{{ end }}
2023-05-17 20:57:01 +02:00
<!---->
{{ if or .Params.math .Site.Params.math }}
<!---->
{{ partial "math.html" . }}
<!---->
{{ end }}
<!---->
2021-08-23 21:59:02 +02:00
<!-- Favicon -->
<link rel="icon" href="{{ `favicon.ico` | absURL }}" />
<link rel="apple-touch-icon" href="{{ `apple-touch-icon.png` | absURL }}" />
<!-- Generator -->
{{ hugo.Generator }}
<!-- RSS -->
{{ range .AlternativeOutputFormats }}
<link
rel="{{ .Rel }}"
type="{{ .MediaType.Type }}"
href="{{ .Permalink }}"
title="{{ site.Title }}"
/>
{{ end }}
<!-- Misc -->
2021-08-24 13:10:32 +02:00
{{ if or hugo.IsProduction (eq site.Params.env "production") }}
2021-08-23 21:59:02 +02:00
<!---->
2022-01-06 16:06:05 +01:00
{{ template "_internal/google_analytics.html" . }}
<!---->
2021-08-23 21:59:02 +02:00
{{ template "_internal/opengraph.html" . }}
<!---->
{{ template "_internal/schema.html" . }}
<!---->
{{ template "_internal/twitter_cards.html" . }}
<!---->
{{ end }}
</head>