]> danix's work - danix2-hugo-theme.git/commitdiff
layout: create base layout, header, footer, hero, and post card partials
authorDanilo M. <redacted>
Sun, 5 Apr 2026 06:41:04 +0000 (08:41 +0200)
committerDanilo M. <redacted>
Sun, 5 Apr 2026 06:41:04 +0000 (08:41 +0200)
layouts/_partials/footer.html
layouts/_partials/head.html
layouts/_partials/header.html
layouts/_partials/hero.html [new file with mode: 0644]
layouts/_partials/matrix-canvas.html [new file with mode: 0644]
layouts/_partials/post-card.html [new file with mode: 0644]
layouts/baseof.html

index a7cd916d054898baf4b77b5780c7d4843dc6ff4f..a9df047b181219152a171a1d761c58cdfc1f5067 100644 (file)
@@ -1 +1,14 @@
-<p>Copyright {{ now.Year }}. All rights reserved.</p>
+<div class="footer-container">
+  <div class="footer-content">
+    <div class="footer-copyright">
+      © {{ now.Year }} {{ .Site.Params.author }}. All rights reserved.
+    </div>
+    <nav>
+      <ul class="footer-nav">
+        {{ range .Site.Menus.main }}
+          <li><a href="{{ .URL }}">{{ .Name }}</a></li>
+        {{ end }}
+      </ul>
+    </nav>
+  </div>
+</div>
index 02c224018959dcf2eef9da89a66f54a287bcb140..1a8a727431ba0e21d13630ce57dce3a2032219c8 100644 (file)
@@ -1,5 +1,8 @@
 <meta charset="utf-8">
-<meta name="viewport" content="width=device-width">
-<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="description" content="{{ .Site.Params.description }}">
+<meta name="theme-color" content="#060b10">
+<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
+
 {{ partialCached "head/css.html" . }}
 {{ partialCached "head/js.html" . }}
index 7980a00e1e2613fa8adc68e98a99460bd6131422..872c20712dd08209688c6eabb8f5a4f18011f0da 100644 (file)
@@ -1,2 +1,17 @@
-<h1>{{ site.Title }}</h1>
-{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
+<div class="header-container">
+  <a href="/" class="site-title">{{ .Site.Params.author }}</a>
+  <div class="header-controls">
+    <nav>
+      <ul>
+        {{ range .Site.Menus.main }}
+          <li>
+            <a href="{{ .URL }}" {{ if (in $.RelPermalink .URL) }}class="active"{{ end }}>
+              {{ .Name }}
+            </a>
+          </li>
+        {{ end }}
+      </ul>
+    </nav>
+    <button id="theme-toggle-btn" class="theme-toggle" aria-label="Toggle theme">🌙 dark</button>
+  </div>
+</div>
diff --git a/layouts/_partials/hero.html b/layouts/_partials/hero.html
new file mode 100644 (file)
index 0000000..11034be
--- /dev/null
@@ -0,0 +1,11 @@
+<section class="hero">
+  {{ partial "matrix-canvas.html" . }}
+  <div class="hero-content">
+    <div class="hero-avatar">{{ .Site.Params.avatar }}</div>
+    <div class="hero-text">
+      <h1>{{ .Site.Params.author }}</h1>
+      <div class="hero-role">// engineer • writer • human</div>
+      <p class="hero-bio">{{ .Site.Params.description }}</p>
+    </div>
+  </div>
+</section>
diff --git a/layouts/_partials/matrix-canvas.html b/layouts/_partials/matrix-canvas.html
new file mode 100644 (file)
index 0000000..b10b471
--- /dev/null
@@ -0,0 +1 @@
+<canvas id="matrix-canvas"></canvas>
diff --git a/layouts/_partials/post-card.html b/layouts/_partials/post-card.html
new file mode 100644 (file)
index 0000000..7dd8c9a
--- /dev/null
@@ -0,0 +1,16 @@
+{{ $featured := .featured }}
+<article class="post-card {{ if $featured }}featured{{ end }}">
+  {{ if .image }}
+    <img src="{{ .image }}" alt="{{ .title }}" class="post-card-image">
+  {{ else }}
+    <div class="post-card-image" style="background: linear-gradient(135deg, var(--color-{{ .type }}), var(--bg2));"></div>
+  {{ end }}
+  <div class="post-card-body">
+    <div class="post-type-badge {{ .type }}">{{ .type }}</div>
+    <h3 class="post-card-title"><a href="{{ .url }}">{{ .title }}</a></h3>
+    <p class="post-card-excerpt">{{ .description }}</p>
+    <div class="post-card-meta">
+      <span>{{ dateFormat "Jan 2, 2006" .date }}</span>
+    </div>
+  </div>
+</article>
index 7d17aa55c30d0d6718e0f2c831c16aebceb86d02..ad6613f541eb4b30b787567a2d031c8ec7f83ec8 100644 (file)
@@ -4,14 +4,9 @@
   {{ partial "head.html" . }}
 </head>
 <body>
-  <header>
-    {{ partial "header.html" . }}
-  </header>
-  <main>
-    {{ block "main" . }}{{ end }}
-  </main>
-  <footer>
-    {{ partial "footer.html" . }}
-  </footer>
+  <div class="reading-progress"></div>
+  <header>{{ partial "header.html" . }}</header>
+  <main>{{ block "main" . }}{{ end }}</main>
+  <footer>{{ partial "footer.html" . }}</footer>
 </body>
 </html>