baseof.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. {{- $language_code := site.LanguageCode | default "en-us" -}}
  3. <html lang="{{$language_code}}" {{ if in site.Data.i18n.rtl.rtl $language_code }}dir="rtl"{{end}}>
  4. {{ partial "site_head" . }}
  5. {{ $show_navbar := site.Params.main_menu.enable | default true }}
  6. {{- $highlight_active_link := site.Params.main_menu.highlight_active_link | default true -}}
  7. <body id="top" data-spy="scroll" {{ if $show_navbar }}data-offset="70"{{end}} data-target="{{ if or .IsHome (eq .Type "widget_page") | and $highlight_active_link }}#navbar-main{{else}}#TableOfContents{{end}}" class="page-wrapper {{with .Params.design.css_class}}{{.}}{{end}} {{ if not (.Scratch.Get "light") }}dark{{end}} {{ if not $show_navbar }}no-navbar{{end}}" {{with .File}}data-wc-page-id="{{.File.UniqueID}}"{{end}} {{with .Params.design.css_style}}style="{{. | safeCSS}}"{{end}}>
  8. {{/* Initialise Wowchemy. */}}
  9. {{ $js_license := printf "/*! Wowchemy v%s | https://wowchemy.com/ */\n" site.Data.wowchemy.version }}
  10. {{ $js_license := $js_license | printf "%s/*! Copyright 2016-present George Cushen (https://georgecushen.com/) */\n" }}
  11. {{ $js_license := $js_license | printf "%s/*! License: https://github.com/wowchemy/wowchemy-hugo-modules/blob/main/LICENSE.md */\n" }}
  12. {{ $js_bundle_head := $js_license | resources.FromString "js/bundle-head.js" }}
  13. {{ $wcDarkLightEnabled := site.Params.day_night | default false }}
  14. {{ $wcIsSiteThemeDark := not (.Scratch.Get "light") | default false }}
  15. {{ $js_params := dict "wcDarkLightEnabled" $wcDarkLightEnabled "wcIsSiteThemeDark" $wcIsSiteThemeDark }}
  16. {{ $js_bundle := resources.Get "js/wowchemy-init.js" | js.Build (dict "params" $js_params) }}
  17. {{- if hugo.IsProduction -}}
  18. {{- $js_bundle = $js_bundle | js.Build (dict "format" "iife") | minify -}}
  19. {{- else -}}
  20. {{- $js_bundle = $js_bundle | js.Build (dict "format" "iife" "sourceMap" "inline") -}}
  21. {{ end }}
  22. {{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat "js/wowchemy-init.min.js" }}
  23. {{- if hugo.IsProduction -}}
  24. {{ $js_bundle = $js_bundle | fingerprint "md5" }}
  25. {{- end -}}
  26. <script src="{{ $js_bundle.RelPermalink }}"></script>
  27. {{ partial "search" . }}
  28. <div class="page-header">
  29. {{ partial "navbar" . }}
  30. </div>
  31. <div class="page-body">
  32. {{ block "main" . }}{{ end }}
  33. </div>
  34. <div class="page-footer">
  35. {{/* Docs and Updates layouts include the site footer in a different location. */}}
  36. {{ if not (in (slice "book" "docs" "updates") .Type) }}
  37. <div class="container">
  38. {{ partial "site_footer" . }}
  39. </div>
  40. {{ end }}
  41. </div>
  42. {{ partial "citation" . }}
  43. {{ partial "site_js" . }}
  44. </body>
  45. </html>