<!DOCTYPE html>
<html lang="{{ .Language.Lang }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>{{ block "title" . }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
        {{ $favicon := resources.Get "img/favicon.ico" }}
        <link rel="icon" href="{{ $favicon.Permalink }}" type="image/ico">
        {{ with .OutputFormats.Get "rss" -}}
            <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink }}" title="{{ $.Site.Title }}">
        {{- end }}
        {{ block "css" . -}}
            <link rel="stylesheet" href="https://unpkg.com/firacode@1.206.0/distr/fira_code.css">
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" integrity="sha256-+N4/V/SbAFiW1MPBCXnfnP9QSN3+Keu+NlB+0ev/YKQ=" crossorigin="anonymous" />
            {{ partial "sass.html" "css/main.scss" }}
            <meta name="theme-color" content="#0b2a37">
        {{- end }}
        {{ block "og" . -}}
            {{ $ogimg := resources.Get "img/og-img.png" }}
            {{ if eq .IsPage true }}
                <meta property="og:title" content="{{ .Title }} | {{ .Site.Title }}">
                <meta property="og:type" content="article">
                <meta property="og:image" content="{{ $ogimg.Permalink }}">
                <meta property="og:image:alt" content="{{ T "logo-alt" }}" />
                <meta property="og:url" content="{{ .Permalink }}">
                <meta property="og:description" content="{{ .Summary | truncate 120 }}">
                <meta property="og:locale" content="{{ index .Site.Data.languages .Language.Lang }}">
                <meta property="og:site_name" content="{{ .Site.Title }}">
                {{ range .Translations }}
                    <meta property="og:locale:alternative" content="{{ index .Site.Data.languages .Lang }}">
                {{ end }}
                <meta property="og:article:published_date" content="{{ .PublishDate }}">
                {{ range .Params.authors }}
                    <meta property="og:article:author" content="{{ . }}">
                {{ end }}
                {{ range .Params.tags }}
                    <meta property="og:article:tag" content="{{ . }}">
                {{ end }}
                <meta property="og:article:section" content="{{ .Section }}">
            {{ end }}
            {{ if eq .IsHome true }}
                <meta property="og:title" content="Pátek.cz">
                <meta property="og:type" content="website">
                <meta property="og:image" content="{{ $ogimg.Permalink }}">
                <meta property="og:image:alt" content="{{ T "logo-alt" }}" />
                <meta property="og:url" content="{{ .Permalink }}">
                <meta property="og:description" content="{{ .Summary }}">
                <meta property="og:locale" content="{{ index .Site.Data.languages .Language.Lang }}">
                <meta property="og:site_name" content="{{ .Site.Title }}">
                {{ range .Translations }}
                    <meta property="og:locale:alternative" content="{{ index .Site.Data.languages .Lang }}">
                {{ end }}
            {{ end }}
        {{ end -}}

        {{ block "js" . -}}
            {{ partial "js.html" "js/header-link.js" }}
            {{ partial "js.html" "js/patek-logo-custom-element/patek-logo.js" }}
            {{ partial "js.html" "js/dark-mode.js" }}
        {{ end }}
    </head>
    <body>
        {{ block "body" . }}
            {{- partial "header.html" . -}}
            <div id="content">
                <div class="section">
                    <div class="container">
                        {{- block "main" . }}{{- end }}
                    </div>
                </div>
            </div>
            {{- partial "footer.html" . -}}
        {{ end }}
    </body>
</html>
