Welcome to mirror list, hosted at ThFree Co, Russian Federation.

head.html « partials « layouts - github.com/kdevo/osprey-delight.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c33b32127d3e52fa4ec38f2e898c528661dd186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{{ if .IsHome -}}
  {{ .Scratch.Set "title" .Site.Title }}
{{- else if .Params.heading -}}
  {{ .Scratch.Set "title" .Params.heading }}
{{- else -}}
  {{ .Scratch.Set "title" (printf "%s | %s" .Title .Site.Title) }} 
{{- end }}
{{ range .Site.Menus.main -}}
  {{ $.Page.Scratch.Set .Identifier . }}
{{- end }}
<head>
  <title>{{ .Scratch.Get "title" }}</title>

  <meta name="title" content="{{ .Scratch.Get "title" }}">

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="referrer" content="strict-origin-when-cross-origin">
  <base href="{{ .Site.BaseURL }}">

  {{ if .Description -}}
    <meta name="description" content="{{ .Description }}">
  {{- else if .Site.Params.description -}}
    <meta name="description" content="{{ .Site.Params.description }}">
  {{- else if .Summary -}}
    <meta name="description" content="{{ .Summary }}">
  {{- end }}

  {{ if .Site.Params.author -}}
    <meta name="author" content="{{ .Site.Params.author }}">
  {{- end }}

  {{ with .Site.Params.Social -}}
    {{ $twitter := index (where . "type" "==" "twitter") 0 }}
    {{ with $twitter }}
      <meta name="twitter:card" content="summary_large_image">
      <meta name="twitter:site" content="@{{ default $.Site.Params.author .name }}">
      <meta name="twitter:creator" content="@{{ default $.Site.Params.author .name }}">
    {{- end }}
  {{ end -}}

  <meta property="og:title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else if .Params.heading }}{{ .Params.heading }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}">
  <meta property="og:type" content="website">
  <meta property="og:url" content="{{ .Permalink }}">
  {{ with .Site.Params.opengraphImage -}}
    {{ with resources.Get . -}}
        {{ $img := .Fill "1280x640 Lanczos Center" }}
        {{ $img = slice $img | resources.Concat (printf "opengraph%s" (path.Ext .)) }}
        <meta property="og:image" content="{{ $img.Permalink }}">
        <meta property="og:image:width" content="{{ $img.Width }}">
        <meta property="og:image:height" content="{{ $img.Height }}">
    {{- else -}}
        <meta property="og:image" content="{{ . | absURL }}">
    {{- end }}
  {{- end }}
  {{ with .Site.Params.favicon -}}
    {{ with (resources.Get .) -}}
        {{ $img := slice (.Fill "192x192 png Lanczos Center") | resources.Concat "favicon.png" }}
        <link rel="icon" type="image/png" href="{{ $img.Permalink }}">
    {{- else -}}
      <link rel="icon" type="image/png" href="{{ . | absURL }}">
    {{- end }}
  {{- end }}

  {{ if .Description -}}
    <meta name="og:description" content="{{ .Description }}">
  {{- else if .Site.Params.description -}}
    <meta property="og:description" content="{{ .Site.Params.description}}">
  {{- else if .Summary -}}
    <meta name="og:description" content="{{ .Summary }}">
  {{- end }}

  {{ with .Site.Params.themeColor }}
  <meta name="theme-color" content="{{ . }}">
  {{ end }}

  <link rel="canonical" href="{{ .Permalink }}">
  
  {{ with .OutputFormats.Get "RSS" -}}
    <link href="{{ .Permalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}">
  {{- end }}

  <link rel="stylesheet" href="{{ (resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "style.css" "outputStyle" "compressed") | resources.Fingerprint).Permalink }}">

  {{ if .Site.Params.Feat.useStructuredData -}}
    {{ $s := (resources.Get "person.json" | resources.ExecuteAsTemplate "person.json" .).Content }}
    <script type="application/ld+json">
    {{ $s | safeJS }}
    </script>
    {{/* Validate what we have rendered to prevent bad surprises */}}
    {{ $_ := unmarshal $s }}
  {{- end }}

  {{ partial "lazyimg-setup" . }}

  {{ if .Site.Params.Feat.googleTagManager }}
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','{{ .Site.Params.Feat.googleTagManager }}');</script>
    <!-- End Google Tag Manager -->
  {{ end }}

  {{ if .Site.GoogleAnalytics }}
    {{ template "_internal/google_analytics_async.html" . }}
  {{ end }}

  {{ partial "head-extended.html" . }}
</head>