Pi66

pi66.xyz
My personal website.
git clone https://git.pi66.xyz/pi66.xyz

← back to log

feat: split layout into base.html and partials

author: pi66
date: 2026-07-23 10:09
hash: 76b1c891787a1bd356e79647ad3f7cbed1ce4944

Diffstat:

A

src/templates/base.html
17 ++++++++++++++++++

A

src/templates/partials/footer.html
8 +++++++++

A

src/templates/partials/head.html
15 ++++++++++++++++

A

src/templates/partials/header.html
18 +++++++++++++++++++

A

src/templates/partials/mobile-nav.html
7 ++++++++

A

src/templates/partials/repo-nav.html
22 ++++++++++++++++++++++++

A

src/templates/partials/scripts.html
28 ++++++++++++++++++++++++++++++
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
diff --git a/src/templates/base.html b/src/templates/base.html
new file mode 100644
index 0000000..7ef67f2
--- /dev/null
+++ b/src/templates/base.html
@@ -0,0 +1,17 @@
+{% include "partials/head.html" %}
+   <body class="font-[Pixelify] w-screen h-dvh max-w-[1200px] mx-auto overflow-hidden bg-black p-5 pb-0 flex flex-col gap-3">
+       {% include "partials/header.html" %}
+
+       <div class="flex-1 flex flex-col gap-2 overflow-hidden">
+
+           <main class="flex-initial w-full box-border px-3 overflow-x-hidden pb-2 border border-[#333] overflow-y-auto">
+               {{ page_content }}
+           </main>
+
+           {% include "partials/footer.html" %}
+            {% include "partials/mobile-nav.html" %}
+
+       </div>
+   </body>
+   {% include "partials/scripts.html" %}
+</html>
diff --git a/src/templates/partials/footer.html b/src/templates/partials/footer.html
new file mode 100644
index 0000000..343a95c
--- /dev/null
+++ b/src/templates/partials/footer.html
@@ -0,0 +1,8 @@
+<footer class="mt-auto mb-2 h-10  flex flex-col justify-center items-center text-blockquote text-sm border-[#333]">
+               
+                   <div>
+                       <p class="text-gray-300">// Created by <span class="font-bold text-green-500">Pi66</span></p>
+                       <p class="text-gray-300">// Copyright ©Pi66 2026</p>
+                   </div>
+               
+           </footer>
\ No newline at end of file
diff --git a/src/templates/partials/head.html b/src/templates/partials/head.html
new file mode 100644
index 0000000..08ee04f
--- /dev/null
+++ b/src/templates/partials/head.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en">
+   <head>
+       <meta charset="UTF-8">
+       <meta name="viewport" content="width=device-width, initial-scale=1.0">
+       <meta name="description" content="{{ metadata_content | default('A web interface for the pi66.xyz Git server') }}">
+       <meta name="author" content="Pi66">
+       <meta name="theme-color" content="#000000">
+       <title>{{page_title | default('Pixel - Git')}}</title>
+       <link rel="icon" href="/static/favicon.ico">
+       <link rel="stylesheet" href="/static/css/style.css"/>
+       <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser"></script>
+{% if extra_head is defined %}{{ extra_head }}{% endif %}
+
+   </head>
diff --git a/src/templates/partials/header.html b/src/templates/partials/header.html
new file mode 100644
index 0000000..b591e10
--- /dev/null
+++ b/src/templates/partials/header.html
@@ -0,0 +1,18 @@
+<header class="py-2.5 justify-between h-12 px-3 border-[#333333] border-1 flex items-center">
+   <div class="flex items-center">
+       <a href="/" class="flex items-center">
+           <img
+               src="/static/icons/lain.gif" 
+               class="w-10 h-auto rounded-md object-contain saturate-150"
+           />
+           <h1 class="pi66-title ml-4 text-green-700 font-bold !text-2xl">Pi66</h1>
+       </a>
+   </div>
+   <nav class="pr-4 flex items-center text-green-700 transition-colors duration-200 text-2xl font-bold max-md:hidden gap-4">
+       <a class="hover:text-green-400 transition-colors duration-200 " href="/" class="nav-link">home</a>
+       <a class="hover:text-green-400 transition-colors duration-200 " href="/tools" class="nav-link">tools</a>
+       <a class="hover:text-green-400 transition-colors duration-200 " href="/about" class="nav-link">more</a>
+       <a class="hover:text-green-400 transition-colors duration-200 " href="/gaza" class="nav-link">gaza</a>
+       <a class="hover:text-green-400 transition-colors duration-200 " href="https://git.pi66.xyz" class="nav-link">git</a>
+   </nav>
+</header>
diff --git a/src/templates/partials/mobile-nav.html b/src/templates/partials/mobile-nav.html
new file mode 100644
index 0000000..97d94c1
--- /dev/null
+++ b/src/templates/partials/mobile-nav.html
@@ -0,0 +1,7 @@
+<nav class="py-2 mb-2 flex justify-around border-1 border-[#333] items-center text-green-600 transition-colors duration-200 text-xl font-bold min-md:hidden gap-4">
+   <a class="hover:text-green-400 transition-colors duration-200 " href="/" class="nav-link">home</a>
+   <a class="hover:text-green-400 transition-colors duration-200 " href="/tools" class="nav-link">tools</a>
+   <a class="hover:text-green-400 transition-colors duration-200 " href="/about" class="nav-link">more</a>
+   <a class="hover:text-green-400 transition-colors duration-200 " href="/gaza" class="nav-link">gaza</a>
+   <a class="hover:text-green-400 transition-colors duration-200 " href="https://git.pi66.xyz" class="nav-link">git</a>
+</nav>
diff --git a/src/templates/partials/repo-nav.html b/src/templates/partials/repo-nav.html
new file mode 100644
index 0000000..b0e469d
--- /dev/null
+++ b/src/templates/partials/repo-nav.html
@@ -0,0 +1,22 @@
+<div>
+   <blockquote class="!p-0">
+       <p>
+       <strong class="text-xl"> {{ repo_name }} </strong>
+       {% if repo_desc %}
+           <br>
+           {{ repo_desc }}
+       {% endif %}
+       <br>
+       git clone <a href="https://git.pi66.xyz/{{repo_name | lower}}" > https://git.pi66.xyz/{{repo_name | lower}} </a>
+       </p>
+   </blockquote>
+
+</div>
+
+<nav class="flex gap-4 mb-4 pb-2 border-b border-[#333] text-sm">
+   <a class="text-gray-400 text-green-400 font-bold" href="/{{repo_name | lower}}/log.html">Log</a> |
+   <a class="text-gray-400 hover:text-green-400"     href="/{{repo_name | lower}}/files.html">Files</a> |
+   <a class="text-gray-400 hover:text-green-400"     href="/{{repo_name | lower}}/refs.html">Refs</a> |
+   <a class="text-gray-400 hover:text-green-400"     href="/{{repo_name | lower}}/readme.html">README</a> |
+   <a class="text-gray-400 hover:text-green-400"     href="/{{repo_name | lower}}/license.html">LICENSE</a>
+</nav>
diff --git a/src/templates/partials/scripts.html b/src/templates/partials/scripts.html
new file mode 100644
index 0000000..063f61e
--- /dev/null
+++ b/src/templates/partials/scripts.html
@@ -0,0 +1,28 @@
+<script>
+        function typePerLetter(selector, speed = 100) {
+            const el = document.querySelector(selector);
+            if (!el) return;
+
+            const text = el.textContent;
+            el.textContent = "";
+            let i = 0;
+
+            const interval = setInterval(() => {
+                if (i >= text.length) {
+                    clearInterval(interval);
+                    return;
+                }
+
+                const char = text[i];
+                if (char === "\n") {
+                    el.appendChild(document.createElement("br"));
+                } else {
+                    el.append(char);
+                }
+                i++;
+            }, speed);
+        }
+
+        typePerLetter(".pi66-title", 120);
+        document.body.style.zoom = "100%";
+    </script>
\ No newline at end of file