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

head.html « partials « layouts - github.com/cntrump/hugo-notepadium.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ddb6a3c30a0d74246b6e13c7acf41468d5029521 (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

<meta charset="utf-8">
{{ hugo.Generator }}
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<meta name="color-scheme" content="light only">
<meta name="supported-color-schemes" content="light only">

{{ define "title" }}
  {{ $title := .Title }}
  {{ if and (ne $title "") (ne $title .Site.Title) }}
    <title>{{ $title | safeHTML }} &ndash; {{ .Site.Title | safeHTML }}</title>
  {{ else }}
    {{ $slogan := .Site.Params.slogan }}
    <title>{{ .Site.Title | safeHTML }}{{ if and (isset .Site.Params "slogan") (ne $slogan "") }} &ndash; {{ $slogan | safeHTML }}{{ end }}</title>
  {{ end }}  
{{ end }}

{{- block "title" . }}{{- end }}

{{ $fontCSS := "" }}
{{ if .Site.Params.syntax.webFonts }}
  {{ $fontCSS = resources.Get "css/source-code-pro.css" }}
{{ end }}

{{ $coreCSS := resources.Get "css/style.css" }}
{{ if ne $fontCSS "" }}
  {{ $coreCSS = slice $fontCSS $coreCSS | resources.Concat "css/tmp.css" }}
{{ end }}

{{ $themePath := "" }}
{{ $theme := "dracula" }}
{{ with .Site.Params.syntax }}
  {{ $use := "none" }}
  {{ if and (isset . "use") (ne .use "") }}{{ $use = .use | lower }}{{ end }}
  {{ if and (isset . "theme") (ne .theme "") }}{{ $theme = .theme | lower }}{{ end }}

  {{ if eq $use "hljs" }}
    {{ $themePath = print (path.Join "css/hljs/" $theme) ".css" }}
  {{ else if eq $use "prismjs" }}
    {{ $themePath = print (path.Join "css/prism/" $theme) ".css" }}
  {{ end }}
{{ end }}

{{ if eq $themePath "" }}
{{ $themePath = print (path.Join "css/chroma/" $theme) ".css" }}
{{ end }}

{{ $themeCSS := resources.Get $themePath }}
{{ $coreCSS = slice $coreCSS $themeCSS | resources.Concat "css/core.css" | minify | fingerprint "sha384" }}
<link rel="stylesheet" href="{{ $coreCSS.RelPermalink }}" integrity="{{ $coreCSS.Data.Integrity }}">