205 lines
6.6 KiB
HTML
205 lines
6.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="{{ site.Language }}" dir="{{ .Language.LanguageDirection | default "auto" }}">
|
|
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
|
<!-- Include core CSS files -->
|
|
<link rel="stylesheet" href="{{ "css/core/reset.css" | relURL }}">
|
|
<link rel="stylesheet" href="{{ "css/core/theme-vars.css" | relURL }}">
|
|
<link rel="stylesheet" href="{{ "css/core/zmedia.css" | relURL }}">
|
|
|
|
<!-- Include concatenated and minified stylesheet -->
|
|
{{- $theme_vars := (resources.Get "css/core/theme-vars.css") }}
|
|
{{- $reset := (resources.Get "css/core/reset.css") }}
|
|
{{- $media := (resources.Get "css/core/zmedia.css") }}
|
|
{{- $license_css := (resources.Get "css/core/license.css") }}
|
|
{{- $common := (resources.Match "css/common/*.css") | resources.Concat "assets/css/common.css" }}
|
|
{{- $core := (slice $theme_vars $reset $common $media) | resources.Concat "assets/css/core.css" | resources.Minify }}
|
|
<link rel="stylesheet" href="{{ $core.RelPermalink }}">
|
|
|
|
<style>
|
|
.main-screen {
|
|
box-sizing: border-box;
|
|
-moz-box-sizing: border-box;
|
|
-webkit-box-sizing: border-box;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
position: absolute;
|
|
top: 0px;
|
|
left: 0px;
|
|
width: 100%;
|
|
max-width: 100%;
|
|
padding: 0px 10px;
|
|
gap: 2rem;
|
|
}
|
|
|
|
.side-screen {
|
|
height: 100vh;
|
|
overflow-y: hidden;
|
|
width: 400px;
|
|
min-width: 400px;
|
|
}
|
|
|
|
.main-content {
|
|
position: relative;
|
|
flex-grow: 2;
|
|
width: 100%;
|
|
max-width: 750px;
|
|
}
|
|
|
|
.site-title {
|
|
width: 100%;
|
|
text-align: center;
|
|
}
|
|
|
|
.icon-row {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: center;
|
|
width: 100%;
|
|
gap: 2rem;
|
|
}
|
|
|
|
.icon-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
}
|
|
|
|
@media (max-width: 1380px) {
|
|
.side-screen {
|
|
display: none;
|
|
}
|
|
|
|
.main-screen {
|
|
justify-content: center;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<header>
|
|
<!-- Script to automatically toggle to the right theme -->
|
|
{{- /* theme-toggle is enabled */}}
|
|
{{- if (not site.Params.disableThemeToggle) }}
|
|
{{- /* theme is light */}}
|
|
{{- if (eq site.Params.defaultTheme "light") }}
|
|
<script>
|
|
if (localStorage.getItem("pref-theme") === "dark") {
|
|
document.body.classList.add('dark');
|
|
}
|
|
|
|
</script>
|
|
{{- /* theme is dark */}}
|
|
{{- else if (eq site.Params.defaultTheme "dark") }}
|
|
<script>
|
|
if (localStorage.getItem("pref-theme") === "light") {
|
|
document.body.classList.remove('dark')
|
|
}
|
|
|
|
</script>
|
|
{{- else }}
|
|
{{- /* theme is auto */}}
|
|
<script>
|
|
if (localStorage.getItem("pref-theme") === "dark") {
|
|
document.body.classList.add('dark');
|
|
} else if (localStorage.getItem("pref-theme") === "light") {
|
|
document.body.classList.remove('dark')
|
|
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
document.body.classList.add('dark');
|
|
}
|
|
|
|
</script>
|
|
{{- end }}
|
|
{{- /* theme-toggle is disabled and theme is auto */}}
|
|
{{- else if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark"))}}
|
|
<script>
|
|
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
document.body.classList.add('dark');
|
|
}
|
|
|
|
</script>
|
|
{{- end }}
|
|
|
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<body>
|
|
<div class="main-screen">
|
|
<div class="side-screen">
|
|
{{ partial "posts-defile.html" (dict "context" . "direction" "up") }}
|
|
</div>
|
|
<div class="main-content">
|
|
<h1 class="site-title">{{ .Title }}</h1>
|
|
|
|
{{- if (not site.Params.disableThemeToggle) }}
|
|
<button id="theme-toggle" accesskey="t" title="(Alt + T)" aria-label="Toggle theme">
|
|
<svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24"
|
|
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
stroke-linejoin="round">
|
|
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
|
|
</svg>
|
|
<svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24"
|
|
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="5"></circle>
|
|
<line x1="12" y1="1" x2="12" y2="3"></line>
|
|
<line x1="12" y1="21" x2="12" y2="23"></line>
|
|
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
|
|
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
|
|
<line x1="1" y1="12" x2="3" y2="12"></line>
|
|
<line x1="21" y1="12" x2="23" y2="12"></line>
|
|
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
|
|
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
|
</svg>
|
|
</button>
|
|
{{- end }}
|
|
|
|
|
|
{{ .Content }}
|
|
<div class="icon-row">
|
|
<a class="icon-item" href="/blog">
|
|
<img src="/icon_work.webp" alt="Work icon by Shar"></img>
|
|
<span>Blog</span>
|
|
</a>
|
|
<a class="icon-item" href="/recettes">
|
|
<img src="/icon_work.webp" alt="Work icon by Shar"></img>
|
|
<span>Recettes</span>
|
|
</a>
|
|
<a class="icon-item" href="/livres">
|
|
<img src="/icon_work.webp" alt="Work icon by Shar"></img>
|
|
<span>Livres</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="side-screen">
|
|
{{ partial "posts-defile.html" (dict "context" . "direction" "down") }}
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
<footer>
|
|
<!-- Script to toggle theme. has to be at the end of the page -->
|
|
{{- if (not site.Params.disableThemeToggle) }}
|
|
<script>
|
|
document.getElementById("theme-toggle").addEventListener("click", () => {
|
|
if (document.body.className.includes("dark")) {
|
|
document.body.classList.remove('dark');
|
|
localStorage.setItem("pref-theme", 'light');
|
|
} else {
|
|
document.body.classList.add('dark');
|
|
localStorage.setItem("pref-theme", 'dark');
|
|
}
|
|
})
|
|
|
|
</script>
|
|
{{- end }}
|
|
</footer>
|
|
|
|
</html>
|