baseof.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE html>
  2. <html lang="{{ .Site.Language.Lang }}" dir="{{ $.Param "languagedir" | default "ltr" }}">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>{{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }}</title>
  7. {{ partial "head/scripts" . }}
  8. {{ partial "head/styles" . }}
  9. {{ partial "head/meta" . }}
  10. {{ partial "head/meta_json_ld" . }}
  11. {{ partial "head/services" . }}
  12. </head>
  13. {{ $themeOptions := .Site.Params.themeOptions }}
  14. <body id="root" class="theme__{{ index $themeOptions 0 }}">
  15. <script>
  16. var rootElem = document.getElementById('root');
  17. var themeOptions = JSON.parse({{ $themeOptions | jsonify }});
  18. var localTheme = localStorage.getItem('theme');
  19. if (localTheme) {
  20. if (themeOptions && themeOptions.length > 0) {
  21. themeOptions.includes(localTheme) ?
  22. rootElem.className = `theme__${localTheme}` :
  23. rootElem.className = `theme__${themeOptions[0]}`;
  24. }
  25. }
  26. </script>
  27. <div id="container">
  28. {{ partial "drawer/drawer.html" . }}
  29. {{ partial "navbar/navbar.html" . }}
  30. {{ block "header" . }}{{ end }}
  31. {{ block "main" . }}{{ end }}
  32. {{ partial "footer/footer.html" . }}
  33. </div>
  34. </body>
  35. </html>