baseof.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.header.navbar.enable | default true) | and (ne .Params.header.navbar.enable false)) | or .Params.header.navbar.enable }}
  6. {{- $highlight_active_link := site.Params.header.navbar.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-themes/blob/main/LICENSE.md */\n" }}
  12. {{ $js_bundle_head := $js_license | resources.FromString "js/bundle-head.js" }}
  13. {{ $wcDarkLightEnabled := (and site.Params.appearance.theme_day site.Params.appearance.theme_night) }}
  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. {{/* Breadcrumb */}}
  33. {{/* Don't apply to Book layout as that has different breadcrumb placement. */}}
  34. {{ if .Params.show_breadcrumb | and (ne .Type "book") }}
  35. <!-- Use page bg color rather than any color applied to article-container. -->
  36. {{ $class := cond .IsSection "universal-wrapper" "article-container" }}
  37. <div class="{{$class}} py-1" style="background: initial">
  38. {{ partial "components/breadcrumb" . }}
  39. </div>
  40. {{ end }}
  41. {{ block "main" . }}{{ end }}
  42. </div>
  43. <div class="page-footer">
  44. {{/* Docs and Updates layouts include the site footer in a different location. */}}
  45. {{ if not (in (slice "book" "docs" "updates") .Type) }}
  46. <div class="container">
  47. {{ partial "site_footer" . }}
  48. </div>
  49. {{ end }}
  50. </div>
  51. {{ partial "site_js" . }}
  52. </body>
  53. </html>