2020-02-03 11:38:10 +01:00
{{- /* LoveIt theme version detection */ -}}
2020-01-31 11:46:28 +01:00
{{- if ne .Site.Params.version "0.1.X" -}}
{{- errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/dillonzq/LoveIt#installation \n 2. You have an incompatible update. See https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/dillonzq/LoveIt#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n" -}}
{{- end -}}
2020-02-03 11:38:10 +01:00
2020-02-24 10:00:39 +01:00
{{- $scratch := newScratch -}}
{{- .Scratch.Set "scratch" $scratch -}}
2020-02-14 14:09:21 +01:00
{{- if eq (getenv "HUGO_ENV") "production" -}}
2020-02-24 10:00:39 +01:00
{{- $scratch.Set "production" true -}}
{{- $scratch.Set "CDN" .Site.Params.cdn -}}
2020-02-14 14:09:21 +01:00
{{- end -}}
2019-02-03 12:30:44 +01:00
<!DOCTYPE html>
< html lang = "{{ .Site.LanguageCode }}" >
2019-08-04 15:53:35 +02:00
< head >
< meta charset = "utf-8" >
2020-02-13 18:30:33 +01:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
< meta name = "robots" content = "noodp" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge, chrome=1" >
2020-01-31 15:53:04 +01:00
< title >
{{- block "title" . }}{{ .Site.Title }}{{ end -}}
< / title >
2020-02-13 18:30:33 +01:00
< meta name = "Description" content = "{{ .Params.description | default .Site.Params.description }}" >
{{- partial "head/meta.html" . -}}
{{- partial "head/link.html" . -}}
{{- partial "head/seo.html" . -}}
2019-08-04 15:53:35 +02:00
< / head >
2019-08-21 22:01:02 +02:00
< body >
2020-02-03 11:38:10 +01:00
{{- /* Check theme isDark before body rendering */ -}}
2019-08-21 22:01:02 +02:00
< script >
2020-02-08 15:19:22 +01:00
if (!window.localStorage || !window.localStorage.getItem('theme')) {
2020-02-11 14:40:58 +01:00
{{- $theme := .Site.Params.defaultTheme -}}
{{- if eq $theme "auto" -}}
window.isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
{{- else -}}
window.isDark = '{{ $theme }}' === 'dark';
{{- end -}}
2020-02-08 15:19:22 +01:00
} else {
window.isDark = (window.localStorage & & window.localStorage.getItem('theme')) === 'dark';
}
2019-08-24 13:32:41 +02:00
window.isDark & & document.body.classList.add('dark-theme');
2019-08-21 22:01:02 +02:00
< / script >
2020-02-03 11:38:10 +01:00
{{- /* Body wrapper */ -}}
2019-08-04 15:53:35 +02:00
< div class = "wrapper" >
2020-01-31 11:46:28 +01:00
{{- partial "header.html" . -}}
2019-08-04 15:53:35 +02:00
< main class = "main" >
< div class = "container" >
2020-01-31 11:46:28 +01:00
{{- block "content" . }}{{ end -}}
2019-08-04 15:53:35 +02:00
< / div >
< / main >
2020-01-31 11:46:28 +01:00
{{- partial "footer.html" . -}}
2019-08-04 15:53:35 +02:00
< / div >
2020-02-03 11:38:10 +01:00
{{- /* Dynamic to top button */ -}}
2020-02-16 13:36:36 +01:00
< a href = "#" class = "dynamic-to-top animated faster" id = "dynamic-to-top" >
2020-01-31 11:46:28 +01:00
< span > < / span >
< / a >
2020-02-03 11:38:10 +01:00
2020-02-27 13:14:40 +01:00
{{- /* Load JavaScript scripts and CSS */ -}}
{{- partial "assets.html" . -}}
2019-08-04 15:53:35 +02:00
< / body >
2020-02-06 17:10:00 +01:00
< / html >