baseof.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 {{ if not (.Scratch.Get "light") }}dark{{end}} {{ if not $show_navbar }}no-navbar{{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/master/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 eq hugo.Environment "production" -}}
  18. {{ $js_bundle = $js_bundle | minify }}
  19. {{- end -}}
  20. {{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat "js/wowchemy-init.min.js" }}
  21. {{- if eq hugo.Environment "production" -}}
  22. {{- $js_bundle = $js_bundle | fingerprint "md5" -}}
  23. {{- end -}}
  24. <script src="{{ $js_bundle.RelPermalink }}"></script>
  25. {{ partial "search" . }}
  26. <div class="page-header">
  27. {{ partial "navbar" . }}
  28. </div>
  29. <div class="page-body">
  30. {{ block "main" . }}{{ end }}
  31. </div>
  32. <div class="page-footer">
  33. {{/* Docs and Updates layouts include the site footer in a different location. */}}
  34. {{ if not (in (slice "book" "docs" "updates") .Type) }}
  35. <div class="container">
  36. {{ partial "site_footer" . }}
  37. </div>
  38. {{ end }}
  39. </div>
  40. {{ partial "citation" . }}
  41. {{ partial "site_js" . }}
  42. </body>
  43. </html>