about summary refs log tree commit diff
diff options
context:
space:
mode:
-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 }}