summaryrefslogtreecommitdiffstatshomepage
path: root/templates/macros
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2026-02-02 21:10:12 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2026-02-02 21:10:12 +0530
commitd245c05825743e20d2df2900c4f8313d82ebcfe1 (patch)
treeb82ce18e8b9d2ff3d6c32f152b6d799d27eb4ffa /templates/macros
first commit
Diffstat (limited to 'templates/macros')
-rw-r--r--templates/macros/date.html3
-rw-r--r--templates/macros/header.html26
2 files changed, 29 insertions, 0 deletions
diff --git a/templates/macros/date.html b/templates/macros/date.html
new file mode 100644
index 0000000..020b47e
--- /dev/null
+++ b/templates/macros/date.html
@@ -0,0 +1,3 @@
+{% macro format_date(date) %}
+{{ date | date(format="%d %h, %Y") }}
+{% endmacro format_date %}
diff --git a/templates/macros/header.html b/templates/macros/header.html
new file mode 100644
index 0000000..ff6cd44
--- /dev/null
+++ b/templates/macros/header.html
@@ -0,0 +1,26 @@
+{% macro site_header(activePage="") %}
+<h1><a href="/">{{ config.title }}</a></h1>
+<nav>
+ <ul>
+ <li>
+ <a href="/"{% if activePage == "/" %} id="nav-active-link"{% endif %}>Home</a>
+ </li>
+
+ <li>
+ <a href="/posts"{% if activePage == "/posts" %} id="nav-active-link"{% endif %}>Posts</a>
+ </li>
+
+ <li>
+ <a href="/about"{% if activePage == "/about/" %} id="nav-active-link"{% endif %}>About</a>
+ </li>
+
+ <li>
+ <a href="/guestbook"{% if activePage == "/guestbook/" %} id="nav-active-link"{% endif %}>Guestbook</a>
+ </li>
+
+ <li>
+ <a href="https://vidhukant.com" target="_blank">Main Website</a>
+ </li>
+ </ul>
+</nav>
+{% endmacro header %}