docs/site: create initial version of the layout

It requires simpler modifications than I thought. Pretty interesting.
This commit is contained in:
Gabriel Arazas 2023-07-08 19:59:23 +08:00
parent cac3fa25cf
commit 4d24fa51c3
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
4 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,31 @@
:root {
--gap: 1rem;
}
body {
display: grid;
grid-template-columns: [sidebar] 1fr [content] 3fr;
grid-gap: var(--gap);
overflow: hidden;
padding: 0;
margin: 0;
max-width: unset;
width: 100vw;
height: 100vh;
}
.book.sidebar {
padding: 0 var(--gap);
overflow-y: auto;
resize: horizontal;
}
.book.content {
padding: var(--gap);
overflow-y: auto;
}
article h1 {
font-size: 2rem;
}

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode | default "en" }}">
<head>
{{- partial "head.html" . -}}
</head>
<body>
<section class="book sidebar">
{{ partial "header.html" . }}
<hr aria-hidden="true">
{{ partialCached "chapters.html" . }}
</section>
<section class="book content">
{{ block "main" . }}{{ end }}
{{- partial "footer.html" . -}}
</section>
</body>
</html>

5
docs/layouts/index.html Normal file
View File

@ -0,0 +1,5 @@
{{ define "main" }}
<article>
<main>{{ .Content }}</main>
</article>
{{ end }}

View File

@ -0,0 +1,3 @@
{{ with .Site.GetPage "/menu" }}
{{ .Content | safeHTML }}
{{ end }}