]> danix's work - danix.xyz-2.git/commitdiff
feat: create article type dispatcher template
authorDanilo M. <redacted>
Wed, 15 Apr 2026 13:50:35 +0000 (15:50 +0200)
committerDanilo M. <redacted>
Wed, 15 Apr 2026 13:50:35 +0000 (15:50 +0200)
themes/danix-xyz-hacker/layouts/articles/single.html [new file with mode: 0644]

diff --git a/themes/danix-xyz-hacker/layouts/articles/single.html b/themes/danix-xyz-hacker/layouts/articles/single.html
new file mode 100644 (file)
index 0000000..af51739
--- /dev/null
@@ -0,0 +1,36 @@
+{{ define "main" }}
+{{ $articleType := .Params.type | default "life" }}
+{{ $template := printf "article-types/%s.html" $articleType }}
+<div class="mx-auto px-4 py-12">
+  <div class="grid md:grid-cols-3 gap-8">
+    <!-- Article section -->
+    <div class="md:col-span-2">
+      <!-- Article header -->
+      {{ partial "article-header.html" . }}
+
+      <!-- Type-specific content -->
+      {{ partial $template . }}
+
+      <!-- Tags section -->
+      {{ if .Params.tags }}
+      <div class="border-t border-border pt-8">
+        <h3 class="text-lg font-semibold text-accent mb-4">{{ i18n "tags" }}</h3>
+        <div class="flex flex-wrap gap-2">
+          {{ range .Params.tags }}
+          <a
+            href="/tags/{{ . | urlize }}/"
+            class="inline-flex items-center px-3 py-1 border border-border/30 rounded hover:border-accent/50 hover:text-accent transition-colors text-sm"
+          >
+            {{ . }}
+          </a>
+          {{ end }}
+        </div>
+      </div>
+      {{ end }}
+    </div>
+
+    <!-- Sidebar -->
+    {{ partial "sidebar.html" . }}
+  </div>
+</div>
+{{ end }}