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

baseof.html « _default « layouts - github.com/de-souza/hugo-flex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5282f446e68066caf30f358aa8ca74fdd45ce291 (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
<!DOCTYPE html>
<html lang="{{ site.LanguageCode }}">
<head>
  {{ partial "meta.html" . }}
  <title>
    {{ if eq .Title site.Title }}
    {{ site.Title }}
    {{ else }}
    {{ with .Title }}{{ . }} | {{ end }}{{ site.Title }}
    {{ end }}
  </title>
  <link rel="canonical" href="{{ .Permalink }}">
  {{ range .AlternativeOutputFormats }}
  {{ printf "<link rel=%q type=%q href=%q title=%q>" .Rel .MediaType .Permalink site.Title | safeHTML }}
  {{ end }}
  {{ $basecss := resources.Get "css/base.tpl.css" | resources.ExecuteAsTemplate "css/base.css" . }}
  {{ with site.Params.css }}
  {{ $customcss := slice $basecss }}
  {{ range . }}{{ $customcss = $customcss | append (readFile . | resources.FromString (printf "custom/%s" .)) }}{{ end }}
  {{ $basecss = $customcss | resources.Concat "css/base.css" }}
  {{ end }}
  {{ $basecss | minify | fingerprint | .Page.Scratch.SetInMap "css" "base" }}
  {{ with site.Params.js }}
  {{ $customjs := slice }}
  {{ range . }}{{ $customjs = $customjs | append (readFile . | resources.FromString (printf "custom/%s" .)) }}{{ end }}
  {{ $customjs | resources.Concat "js/base.js" | minify | fingerprint | $.Page.Scratch.SetInMap "js" "base" }}
  {{ end }}
  {{/*
    In the following block, Hugo is forced to stop and pre-render the
    content of the current page with all its shortcodes. Thanks to this
    pre-render, shortcodes can be used to load additional CSS and JS
    resources to specific pages of the website.
  */}}
  {{ block "loadshortcodes" . }}{{ with .Content }}{{ end }}{{ end }}
  {{ range .Scratch.GetSortedMapValues "css" }}
  <link rel="stylesheet" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
  {{ end }}
  {{ range .Scratch.GetSortedMapValues "js" }}
  <script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
  {{ end }}
</head>
<body>
  {{ partialCached "banner.html" . }}
  <main>
    <div class="u-wrapper">
      <div class="u-padding">
        {{ block "main" . }}{{ end }}
      </div>
    </div>
  </main>
  {{ partialCached "footer.html" . }}
</body>
</html>