From 4d24fa51c3982e5241d56e38587cdcddab1c1214 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 8 Jul 2023 19:59:23 +0800 Subject: [PATCH] docs/site: create initial version of the layout It requires simpler modifications than I thought. Pretty interesting. --- docs/assets/scss/extend.scss | 31 +++++++++++++++++++++++++++++ docs/layouts/_default/baseof.html | 17 ++++++++++++++++ docs/layouts/index.html | 5 +++++ docs/layouts/partials/chapters.html | 3 +++ 4 files changed, 56 insertions(+) create mode 100644 docs/assets/scss/extend.scss create mode 100644 docs/layouts/_default/baseof.html create mode 100644 docs/layouts/index.html create mode 100644 docs/layouts/partials/chapters.html diff --git a/docs/assets/scss/extend.scss b/docs/assets/scss/extend.scss new file mode 100644 index 00000000..343adf16 --- /dev/null +++ b/docs/assets/scss/extend.scss @@ -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; +} diff --git a/docs/layouts/_default/baseof.html b/docs/layouts/_default/baseof.html new file mode 100644 index 00000000..da64c0ec --- /dev/null +++ b/docs/layouts/_default/baseof.html @@ -0,0 +1,17 @@ + + + + {{- partial "head.html" . -}} + + + +
+ {{ block "main" . }}{{ end }} + {{- partial "footer.html" . -}} +
+ + diff --git a/docs/layouts/index.html b/docs/layouts/index.html new file mode 100644 index 00000000..72497ca9 --- /dev/null +++ b/docs/layouts/index.html @@ -0,0 +1,5 @@ +{{ define "main" }} +
+
{{ .Content }}
+
+{{ end }} diff --git a/docs/layouts/partials/chapters.html b/docs/layouts/partials/chapters.html new file mode 100644 index 00000000..f51f58f9 --- /dev/null +++ b/docs/layouts/partials/chapters.html @@ -0,0 +1,3 @@ +{{ with .Site.GetPage "/menu" }} + {{ .Content | safeHTML }} +{{ end }}