您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

76 行
3.8KB

  1. <!DOCTYPE html>
  2. <html lang="{{ .Site.LanguageCode }}">
  3. <head>
  4. {{ partial "meta/content-security-policy.html" . }}
  5. {{ .Hugo.Generator }}
  6. <meta charset="utf-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>{{ block "title" . }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
  9. <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
  10. <meta name="keywords" content="{{ if .Keywords }}{{ delimit .Keywords ", " }}{{ else if and .IsPage .Params.tags }}{{ delimit .Params.tags ", " }}{{ else }}{{ range $term, $val := .Site.Taxonomies.categories }}{{ lower (humanize $term) }}, {{ end }}{{ end }}">
  11. {{ $default_noindex_kinds := slice "section" "taxonomy" "taxonomyTerm" }}
  12. {{ $noindex_kinds := .Site.Params.noindex_kinds | default $default_noindex_kinds }}
  13. {{ $is_noindex_true := and (isset .Params "noindex") .Params.noindex }}
  14. {{ if or (in $noindex_kinds .Kind) ($is_noindex_true) }}
  15. <meta name="robots" content="noindex">
  16. {{ end }}
  17. {{ template "_internal/opengraph.html" . }}
  18. {{ template "_internal/twitter_cards.html" . }}
  19. {{ partial "meta/ogimage-maybe.html" . }}
  20. {{ partial "meta/telegram-channel-maybe.html" . }}
  21. {{ if eq .Kind "home" }}
  22. {{ partial "meta/verifications.html" . }}
  23. {{ end }}
  24. {{ partial "meta/http-referrer.html" . }}
  25. {{ $import := resources.Get "/js/vendor/fetch-inject.min.js" }}
  26. {{ $baseof := resources.Get "/js/baseof.js" | resources.ExecuteAsTemplate "baseof.js" . }}
  27. <script integrity="{{ ($import | resources.Fingerprint "sha512").Data.Integrity }}">
  28. {{- $import.Content | safeJS -}}
  29. </script>
  30. <script integrity="{{ ($baseof | resources.Fingerprint "sha512").Data.Integrity }}">
  31. {{- $baseof.Content | safeJS -}}
  32. </script>
  33. {{ partial "head/modules.html" . }}
  34. {{ if .OutputFormats.Get "RSS" }}
  35. <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}">
  36. {{ end }}
  37. <link rel="canonical" href="{{ .Permalink }}">
  38. {{ if (isset .Params "prev") }}
  39. <link rel="prev" href="{{ .Params.prev }}">
  40. {{ end }}
  41. {{ if (isset .Params "next") }}
  42. <link rel="next" href="{{ .Params.next }}">
  43. {{ end }}
  44. {{ partial "head/favicon.html" . }}
  45. {{ partial "global-styles.html" . }}
  46. {{ $highlights := findRE "class\\s*?=\\s*?\".*?\\bhighlight\\b.*?\"|class\\s*?=\\s*?highlight\\b" .Content }}
  47. {{ if ge (len $highlights) 1 }}
  48. <script integrity="sha512-ISTAV0GadOIz/NXXHOS+eCM0ysXVVHhQTlvA6LJxz/DeA5yIxm0Vqf5IE+WH0yuuXkayAKtoZkQ326nch5f/fg==">fetchInject([{{ "/css/syntax.css" | relURL }}]);</script>
  49. <noscript>
  50. <link href="{{ "/css/syntax.css" | relURL }}" rel="stylesheet">
  51. </noscript>
  52. {{ end }}
  53. {{ template "_internal/google_analytics_async.html" . }}
  54. {{ partial "head/custom.html" . }}
  55. </head>
  56. {{ $hackcss_disabled := .Site.Params.hackcss.disabled | default false }}
  57. {{ $hackcss_mode := .Site.Params.hackcss.mode | default "hack" }}
  58. {{ $hackcss_palette := .Site.Params.hackcss.palette | default "dark" }}
  59. <body class="{{ if ne $hackcss_disabled true }}{{ $hackcss_mode }} {{ $hackcss_palette }} main container{{ end }}">
  60. <header>{{ block "header" . }}{{ end }}</header>
  61. <main>{{ block "main" . }}{{ end }}</main>
  62. <footer>
  63. {{ block "footer" . }}{{ end }}
  64. {{ partial "footer/hcard.html" . }}
  65. </footer>
  66. {{ $defaults := .Site.Params.defaults.modules }}
  67. {{ $modules := .Site.Params.modules }}
  68. {{ if (or $modules $defaults) }}
  69. {{ with (default $defaults.toxic_swamp $modules.toxic_swamp) }}
  70. {{ partial "modules/toxic-swamp/toolbar.html" dict }}
  71. {{ end }}
  72. {{ end }}
  73. {{ partial "body/scripts.html" . }}
  74. </body>
  75. </html>