hugo-theme-zzo/layouts/_default/baseof.html

38 lines
1.1 KiB
HTML
Raw Normal View History

2019-11-04 13:09:44 +00:00
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}" dir="{{ $.Param "languagedir" | default "ltr" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{{ block "title" . }}{{ .Title }} {{ .Site.Title }}{{ end }}</title>
{{ partialCached "head/scripts" . }}
{{ partialCached "head/styles" . }}
{{ partial "head/meta" . }}
{{ partial "head/meta_json_ld" . }}
</head>
<body id="root">
<div id="body">
<div class="container wrapper">
{{ partial "navbar/site-nav" . }}
{{ partial "header/site-header" . }}
{{ block "main" . }}{{ end }}
{{ partial "footer/site-footer" . }}
</div>
</div>
</body>
</html>
{{ $defaultTheme := (index .Site.Params.themeOptions 0) }}
<script>
var defaultTheme = JSON.parse({{ $defaultTheme | jsonify }});
var localTheme = localStorage.getItem('theme');
if (localTheme) {
$('#root').attr('class', `theme__${localTheme}`);
} else {
$('#root').attr('class', `theme__${defaultTheme}`);
}
</script>