baseof.html 2.9 KB
Newer Older
Miykael_xxm's avatar
init  
Miykael_xxm 已提交
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
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">

<head>
  <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>

  <meta charset="UTF-8">
  <meta name="language" content="en">
  <meta name="description" content="{{ if .IsHome}}{{ .Site.Params.Description }}{{ else }}{{.Page.Params.Description}}{{ end }}">
  <meta name="keywords" content="{{ delimit .Keywords " , " }}">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <!-- Twitter -->
  {{ if isset .Site.Params "twitter" }}
  <meta name="twitter:card" content="summary" />
  <meta name="twitter:title" content="{{ .Title }}" />
  <meta name="twitter:description" content="{{ if .IsHome }}{{ htmlEscape .Site.Params.description }}{{ else }}{{ htmlEscape .Description }}{{ end }}"/>
  <meta name="twitter:site" content="{{ .Site.Params.twitterSite | default .Site.Params.twitter }}" />
  <meta name="twitter:creator" content="{{ .Site.Params.twitterCreator | default .Site.Params.twitter }}" />
  {{ end }}

  {{ partial "favicon.html" }}

  <!-- Styles -->
  {{ block "styles" . }} {{ end }} <!-- Get "style_opts" variable from "styles" block -->
  {{ $base_styles_opts := .Scratch.Get "style_opts" | default (dict "src" "scss/pages/about.scss" "dest" "css/about.css") }}
  {{ $custom_styles_opts := (dict "src" "scss/custom.scss" "dest" "css/custom.css") }}
  
  {{ $current_page := . }}
  
  {{ range (slice $base_styles_opts $custom_styles_opts) }}
    {{ $style := resources.Get .src | resources.ExecuteAsTemplate .dest $current_page | toCSS | minify | fingerprint }}
    <link type="text/css" rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}"/>
  {{ end }}
  
  {{ range .AlternativeOutputFormats }} 
  {{ printf `<link rel="%s" type="%s+%s" href="%s" title="%s" />` .Rel .MediaType.Type .MediaType.Suffix .Permalink $.Site.Title | safeHTML }} 
  {{ end }} 
  {{ block "links" . }} {{ end }}
  {{ partial "seo-schema.html" .}}

  {{- if not .Site.IsServer -}}
      {{ template "_internal/google_analytics_async.html" . }}
  {{- end -}}
  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?289183eba3a0dc259eb4f916d634fa7d";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
</head>

<body>
  {{ partial "burger.html" .}} 

  {{ partial "nav.html" .}}

  <main>
    {{ block "main" . }} {{ end }}
  </main>

  {{ block "footer" . }} {{ end }}

  {{ $script := resources.Get "js/index.js" | minify | fingerprint }}
  <script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity | safeHTMLAttr }}" crossorigin="anonymous"></script>
  {{ block "scripts" . }} {{ end }}
</body>

</html>