mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-30 01:06:00 -04:00
move light/dark class from <body> to <html> and inline restoration script to (hopefully) improve the white flashes
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
{{- partial "functions/prepare-js" . -}}
|
||||
{{- partial "functions/prepare-css" . -}}
|
||||
|
||||
<html lang="{{ .Site.LanguageCode | default "en" }}">
|
||||
<html lang="{{ .Site.LanguageCode | default "en" }}" class="{{ .Site.Params.Theme.defaultTheme }}">
|
||||
<head>
|
||||
{{ partial "head/_head" . }}
|
||||
</head>
|
||||
<body class="{{ .Site.Params.Theme.defaultTheme }}">
|
||||
<body>
|
||||
{{ partialCached "page/header" . }}
|
||||
<main>
|
||||
{{ block "main" . }}{{ end }}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{{ partial "head/meta" . -}}
|
||||
{{ partial "head/open-graph" . -}}
|
||||
{{ partial "head/canonical" . -}}
|
||||
{{ partialCached "head/restore-theme" . -}}
|
||||
{{ partialCached "head/preload" . -}}
|
||||
{{ partial "head/styles" . -}}
|
||||
{{ partialCached "head/favicons" . -}}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{{ $themeScript := resources.Get "js/restore-theme.js" | js.Build (dict "target" "es2015" "format" "iife") }}
|
||||
{{ with $themeScript }}
|
||||
<script>
|
||||
{{ .Content | safeJS }}
|
||||
</script>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user