about summary refs log tree commit diff
path: root/layouts/_default
diff options
context:
space:
mode:
authorNgô Ngọc Đức Huy <huyngo@disroot.org>2022-12-03 19:36:58 +0700
committerNgô Ngọc Đức Huy <huyngo@disroot.org>2022-12-03 19:36:58 +0700
commit890252ec5e659b439165e0d18ca991ef1bfad9ee (patch)
tree4e3a82a9ca9ee188b6f0f8941fb797bd8e20c3b2 /layouts/_default
parent00fa316382900709b209fd1bc96caa50b5c95c30 (diff)
downloadvictor-890252ec5e659b439165e0d18ca991ef1bfad9ee.tar.gz
Add basic layout
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/baseof.html30
-rw-r--r--layouts/_default/list.html26
-rw-r--r--layouts/_default/single.html25
3 files changed, 81 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..d7bff57
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,30 @@
+{{/*
+SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org>
+
+SPDX-License-Identifier: MIT
+*/}}
+
+<!DOCTYPE html>
+<html lang="{{ .Page.Language.Lang }}">
+<head>
+    {{ block "head" . }}
+        {{ partial "head.html" . }}
+    {{ end }}
+</head>
+<body>
+    <a class="skip-main" href="#main">{{ i18n "skipToContent" | humanize }}</a>
+    <div class="container">
+        <header class="common-header"> 
+            {{ block "header" . }}
+                {{ partial "header.html" . }}
+            {{ end }}
+        </header>
+        <main id="main" tabindex="-1"> 
+            {{ block "main" . }}{{ end }}
+        </main>
+        {{ block "footer" . }}
+            {{ partial "footer.html" . }}
+        {{ end }}
+    </div>
+</body>
+</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644
index 0000000..8a60cb4
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,26 @@
+{{/*
+SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org>
+
+SPDX-License-Identifier: MIT
+*/}}
+
+{{ define "main" }}
+  <section class="index-content">
+    {{ .Content }}
+  </section>
+  <section class="toc">
+    <h1 class="post-title">{{ i18n .Title }}</h1>
+    {{ $pages := where .Pages "Type" "in" site.Params.mainSections }}
+    <ol>
+      {{ range $pages }}
+        <li class="post-short-list h-entry">
+          <h2 class="p-name post-title{{ if .Params.draft }} draft{{end}}">
+            <a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a>
+          </h2>
+          {{ partial "post-language-switcher.html" . }}
+          {{ partial "post-info.html" . }}
+        </li>
+      {{ end }}
+      <li>
+  </section>
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..bd91a76
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,25 @@
+{{/*
+SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org>
+
+SPDX-License-Identifier: MIT
+*/}}
+
+{{ define "main" }}
+  <article class="post h-entry">
+    <header class="post-header">
+      <h1 class="p-name post-title{{ if .Params.draft }} draft{{end}}">{{ trim .Title  " " }}</h1>
+      {{ partial "post-language-switcher.html" . }}
+    </header>
+    <div class="content e-content">
+      {{ .Content }}
+    </div>
+    {{ partial "post-info.html" . }}
+  </article>
+
+  {{ partial "single-extra.html" }}
+
+  {{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }}
+    {{ partial "post-pagination.html" . }}
+  {{ end }}
+
+{{ end }}