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

head.html « partials « layouts - github.com/wlh320/hugo-theme-hulga.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: de32ad101a36d77720629f93b3dc8acbc4173623 (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
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    {{ if .IsHome -}}
      <title>{{ .Site.Title }} | {{ .Site.Params.subtitle}}</title>
      <meta property="og:title" content="{{ .Site.Title }} | {{ .Site.Params.subtitle}}">
      <meta property="og:type" content="website">
      {{ if .Site.Params.keywords }}
      <meta name="Keywords" content="{{.Site.Params.keywords}}">
    {{ end }}
    {{ if .Site.Params.keywords }}
      <meta name="description" content="{{ .Site.Params.description }}">
      {{ end }}
      {{- else -}}
      <title>{{ .Title }} | {{ .Site.Title }}</title>
      <meta property="og:title" content="{{ .Title }} - {{ .Site.Title }}">
      <meta property="og:type" content="article">
      {{ with .Params.date }}
      <meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05+08:00" }}">
      {{ end }}
      {{ with .Params.lastmod }}
      <meta property="article:modified_time" content="{{ .Format "2006-01-02T15:04:05+08:00" }}">
      {{ end }}
      <meta name="Keywords" content="{{ if .Keywords }}{{ .Keywords }}{{ else }}{{ .Site.Params.keywords }}{{ end }}">
      <meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Title }}{{ end }}">
      {{ if .Params.author -}}
      <meta name="author" content="{{ .Params.author }}">
      {{- end }}
    {{- end }}

    {{ $options := (dict "outputStyle" "compressed" "includePaths" (slice "sass")) }}
    {{ $lightScss := resources.Get "css/hulga.scss" }}
    {{ $darkScss := resources.Get "css/hulga-dark.scss" }}
    {{ if .Site.Params.postcss }}
      {{ $light := $lightScss | resources.ExecuteAsTemplate "css/hulga.scss" . | resources.ToCSS $options | postCSS | resources.Minify }}
      <link rel="stylesheet" type="text/css" href="{{ $light.Permalink | relURL }}">
      {{ if .Site.Params.darkMedia }}
      {{ $dark := $darkScss | resources.ExecuteAsTemplate "css/hulga-dark.scss" . | resources.ToCSS $options | postCSS | resources.Minify }}
      <link rel="stylesheet" type="text/css" href="{{ $dark.Permalink | relURL }}" media="(prefers-color-scheme: dark)">
      {{ end }}
    {{ else }}
      {{ $light := $lightScss | resources.ExecuteAsTemplate "css/hulga.scss" . | resources.ToCSS $options }}
      <link rel="stylesheet" type="text/css" href="{{ $light.Permalink | relURL }}">
      {{ if .Site.Params.darkMedia }}
      {{ $dark := $darkScss | resources.ExecuteAsTemplate "css/hulga-dark.scss" . | resources.ToCSS $options }}
      <link rel="stylesheet" type="text/css" href="{{ $dark.Permalink | relURL }}" media="(prefers-color-scheme: dark)">
      {{ end }}
    {{ end }}

</head>