Files
HugoBlox-kit/wowchemy/layouts/_default/baseof.html
T
George Cushen 786b0341ee feat: migrate to ES6 modules + Hugo's JS build system
The latest Hugo version, v0.78, enables support for JS ES6 module build support within Hugo/Go modules.

Initial refactor to ES6 modules with imports/exports. Further refactoring todo.

Refactor to use Hugo's new approach to JS param injection.

Refactor theming code from JQuery to vanilla JS.

Add fix for browser deprecation of the MediaQueryList listener.

Requires Hugo 0.78+

See #1929
See #1930
See #1402
2020-11-15 16:12:52 +00:00

43 lines
1.6 KiB
HTML

<!DOCTYPE html>
{{- $language_code := site.LanguageCode | default "en-us" -}}
<html lang="{{$language_code}}" {{ if in site.Data.i18n.rtl.rtl $language_code }}dir="rtl"{{end}}>
{{ partial "site_head" . }}
{{ $show_navbar := site.Params.main_menu.enable | default true }}
{{- $highlight_active_link := site.Params.main_menu.highlight_active_link | default true -}}
<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}}">
{{/* Initialise theme variation. */}}
{{ $wcDarkLightEnabled := site.Params.day_night | default false }}
{{ $wcIsSiteThemeDark := not (.Scratch.Get "light") | default false }}
{{ $js_params := dict "wcDarkLightEnabled" $wcDarkLightEnabled "wcIsSiteThemeDark" $wcIsSiteThemeDark }}
{{ $js_file := resources.Get "js/wowchemy-init.js" | js.Build (dict "params" $js_params) }}
<script src="{{ $js_file.RelPermalink }}"></script>
{{ partial "search" . }}
<div class="page-header">
{{ partial "navbar" . }}
</div>
<div class="page-body">
{{ block "main" . }}{{ end }}
</div>
<div class="page-footer">
{{/* Docs and Updates layouts include the site footer in a different location. */}}
{{ if not (in (slice "book" "docs" "updates") .Type) }}
<div class="container">
{{ partial "site_footer" . }}
</div>
{{ end }}
</div>
{{ partial "citation" . }}
{{ partial "site_js" . }}
</body>
</html>