about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNgô Ngọc Đức Huy <huyngo@disroot.org>2023-07-28 20:50:19 +0700
committerNgô Ngọc Đức Huy <huyngo@disroot.org>2023-07-28 20:50:19 +0700
commit1ce0ada18e576a5aaac0d3dc28bd60575a1fdab8 (patch)
tree53499c577b96c91f83860c6d662819c9ae97f3fb
parentf77a7a18d6f272aee21d77df9775600574cb2b00 (diff)
downloadvictor-1ce0ada18e576a5aaac0d3dc28bd60575a1fdab8.tar.gz
Add layout for book and post
-rw-r--r--.reuse/dep52
-rw-r--r--archetypes/blog.md6
-rw-r--r--archetypes/book.md6
-rw-r--r--archetypes/default.md6
-rw-r--r--layouts/_default/list.html15
5 files changed, 27 insertions, 8 deletions
diff --git a/.reuse/dep5 b/.reuse/dep5
index 317d529..7b33825 100644
--- a/.reuse/dep5
+++ b/.reuse/dep5
@@ -3,7 +3,7 @@ Upstream-Name: victor
 Upstream-Contact: Ngô Ngọc Đức Huy <huyngo@disroot.org>
 Source: https://git.sr.ht/~huyngo/victor
 
-Files: layouts/*
+Files: layouts/* archetypes/*
 Copyright: 2022-2023 Ngô Ngọc Đức Huy <huyngo@disroot.org>
 License: MIT
 
diff --git a/archetypes/blog.md b/archetypes/blog.md
new file mode 100644
index 0000000..e5acb6f
--- /dev/null
+++ b/archetypes/blog.md
@@ -0,0 +1,6 @@
++++
+title: "{{ replace .Name "-" " " | title }}"
+date: {{ .Date }}
+categories: [ blog ]
+draft: true
++++
diff --git a/archetypes/book.md b/archetypes/book.md
new file mode 100644
index 0000000..0da07c8
--- /dev/null
+++ b/archetypes/book.md
@@ -0,0 +1,6 @@
++++
+title: "{{ replace .Name "-" " " | title }}"
+weight: 
+categories: [ book ]
+draft: true
++++
diff --git a/archetypes/default.md b/archetypes/default.md
index d6c9481..351a260 100644
--- a/archetypes/default.md
+++ b/archetypes/default.md
@@ -1,9 +1,3 @@
-<!--
-SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org>
-
-SPDX-License-Identifier: MIT
--->
-
 +++
 title: "{{ replace .Name "-" " " | title }}"
 date: {{ .Date }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index dfd346c..ecac06c 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -8,8 +8,8 @@ SPDX-License-Identifier: MIT
   <section class="index-content">
     {{ .Content }}
   </section>
+  {{ if in .Params.categories "book" }}
   <section class="toc">
-    <h1 class="post-title">{{ i18n .Title }}</h1>
     <ol>
       {{ range sort .Pages "Weight" }}
         <li>
@@ -20,4 +20,17 @@ SPDX-License-Identifier: MIT
       {{ end }}
       <ol>
   </section>
+  {{ else }}
+  <section class="feed">
+    <ol>
+      {{ range sort .Pages "Date" }}
+        <li>
+          <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a>
+          {{ partial "post-language-switcher.html" . }}
+          {{ partial "post-info.html" . }}
+        </li>
+      {{ end }}
+      <ol>
+  </section>
+  {{ end }}
 {{ end }}