Pi66

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

← back to log

refactor: extract duplicated nav links into shared partials/nav.html

author: pi66
date: 2026-07-23 11:30
hash: ab8fa3254b9ef0bdc703560422a86ca48917fae2

Diffstat:

M

src/templates/partials/header.html
8 ++++++++----------------------

M

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

A

src/templates/partials/nav.html
5 +++++++++++++++++++
 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
diff --git a/src/templates/partials/header.html b/src/templates/partials/header.html
index b591e10..4badf43 100644
--- a/src/templates/partials/header.html
+++ b/src/templates/partials/header.html
@@ -8,11 +8,7 @@
            <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 class="pr-4 flex items-center text-green-700 transition-colors duration-200 text-xl font-bold max-md:hidden gap-4">
+       {% include "partials/nav.html" %}
    </nav>
 </header>
diff --git a/src/templates/partials/mobile-nav.html b/src/templates/partials/mobile-nav.html
index 97d94c1..3514116 100644
--- a/src/templates/partials/mobile-nav.html
+++ b/src/templates/partials/mobile-nav.html
@@ -1,7 +1,4 @@
 <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>
+   {% include "partials/nav.html" %}
+
 </nav>
diff --git a/src/templates/partials/nav.html b/src/templates/partials/nav.html
new file mode 100644
index 0000000..d09cc0e
--- /dev/null
+++ b/src/templates/partials/nav.html
@@ -0,0 +1,5 @@
+<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="https://git.pi66.xyz" class="nav-link">Repos</a>
+<a class="hover:text-green-400 transition-colors duration-200 " href="/about" class="nav-link">About</a>
+<a class="hover:text-green-400 transition-colors duration-200 " href="https://blogs.pi66.xyz" class="nav-link">Blogs</a>
+<a class="hover:text-green-400 transition-colors duration-200 " href="/gaza" class="nav-link">Gaza</a>