Files
mehl.mx/themes/hugo-sustain/layouts/partials/head.html

59 lines
2.5 KiB
HTML
Raw Normal View History

2019-03-18 16:50:46 +01:00
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
2020-02-14 10:54:17 +01:00
<!-- set variables -->
{{- $title := "" -}}
{{- if .IsHome -}}
{{- $title = .Site.Title -}}
{{- else -}}
{{- if .Params.heading -}}
{{- $title = .Params.heading -}}
{{- else -}}
{{- $title = print .Site.Title " | " .Title -}}
{{- end -}}
{{- end -}}
2019-03-19 15:51:07 +01:00
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
2019-03-18 16:50:46 +01:00
<meta name="author" content="{{ .Site.Params.Author }}" />
2019-03-19 15:51:07 +01:00
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}" />{{ end }}
2020-02-14 10:54:17 +01:00
{{ with .Site.Params.keywords }}<meta name="keywords" content="{{ . }}" />{{ end }}
2019-03-19 15:51:07 +01:00
<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.BaseURL }}img/favicon.ico" />
2019-10-21 20:05:58 +02:00
<link href="/blog/index.xml" rel="alternate" type="application/rss+xml" title="Max Mehl - blog feed">
<link href="/categories/english/index.xml" rel="alternate" type="application/rss+xml" title="Max Mehl - blog feed (EN)">
<link href="/categories/deutsch/index.xml" rel="alternate" type="application/rss+xml" title="Max Mehl - blog feed (DE)">
2020-02-14 10:54:17 +01:00
<title>{{ $title }}</title>
<!-- CSS and JS -->
{{- partialCached "head/css.html" . }}
2020-02-14 10:54:17 +01:00
2026-02-12 23:26:11 +01:00
<!-- Get image for social media sharing -->
{{- $image := "" -}}
{{- $imagesrc := (.Page.Params.headerimage.src | default .Site.Params.avatar) -}}
{{- if eq .Page.BundleType "leaf" }}
{{- with .Page.Resources.GetMatch $imagesrc }}
{{- $image = . -}}
{{- end }}
{{- else }}
{{- with resources.GetMatch (printf "**/%s" $imagesrc) }}
{{- $image = . -}}
{{- end }}
{{- end }}
{{- if $image }}
{{- $image = $image.Fill "1200x630 jpg" -}}
{{- end }}
2020-02-14 10:54:17 +01:00
2026-02-12 23:26:11 +01:00
<!-- Open Graph meta-data (e.g. Facebook) -->
<meta property="og:type" content="article"/>
<meta property="og:site_name" content="{{ .Site.Title }}"/>
<meta property="og:title" content="{{ $title }}"/>
<meta property="og:url" content="{{ .Permalink }}"/>
<meta property="og:description" content="{{ (.Summary | default .Site.Params.description) | truncate 200 }}"/>
{{- with $image }}
<meta property="og:image" content="{{ .Permalink }}"/>
<meta property="og:image:type" content="{{ .MediaType }}">
<meta property="og:image:width" content="{{ .Width }}">
<meta property="og:image:height" content="{{ .Height }}">
{{- end }}
2019-03-18 16:50:46 +01:00
</head>