]> zackmdavis.net Git - An_Algorithmic_Lucidity.git/commitdiff
check in templates
authorZack M. Davis <code@zackmdavis.net>
Tue, 14 Jul 2026 00:01:03 +0000 (17:01 -0700)
committerZack M. Davis <code@zackmdavis.net>
Tue, 14 Jul 2026 00:01:03 +0000 (17:01 -0700)
theme/templates/article.html [new file with mode: 0644]
theme/templates/base.html [new file with mode: 0644]
theme/templates/index.html [new file with mode: 0644]

diff --git a/theme/templates/article.html b/theme/templates/article.html
new file mode 100644 (file)
index 0000000..f23efd8
--- /dev/null
@@ -0,0 +1,24 @@
+{% extends "base.html" %}
+
+{% block title %}{{ article.title }} - {{ SITENAME }}{% endblock %}
+
+{% block content %}
+    <article class="post">
+        <h2 class="post-title">{{ article.title }}</h2>
+        <div class="post-meta">
+            <time datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%-d %B %Y') }}</time>
+            {% if article.category %}
+                | Category: <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
+            {% endif %}
+            {% if article.tags %}
+                | Tags:
+                {% for tag in article.tags %}
+                    <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
+                {% endfor %}
+            {% endif %}
+        </div>
+        <div class="post-content">
+            {{ article.content }}
+        </div>
+    </article>
+{% endblock %}
diff --git a/theme/templates/base.html b/theme/templates/base.html
new file mode 100644 (file)
index 0000000..d0203ef
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>{% block title %}{{ SITENAME }}{% endblock %}</title>
+    <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/style.css">
+</head>
+<body>
+    <header>
+        <div class="container">
+            <h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>
+        </div>
+    </header>
+
+    <div class="container main">
+        <div class="content">
+            {% block content %}
+            {% endblock %}
+        </div>
+
+        <aside class="sidebar">
+            <div class="widget">
+                <h3>Archives</h3>
+                <ul>
+                {% for year, articles in dates|groupby('date.year')|reverse %}
+                    <li><strong>{{ year }}</strong>
+                        <ul>
+                        {% for month_num, month_articles in articles|groupby('date.month')|reverse %}
+                            <li>
+                                <a href="{{ SITEURL }}/{{ month_articles[0].date.strftime('%Y/%m') }}/">
+                                    {{ month_articles[0].date.strftime('%B %Y') }}
+                                </a>
+                                ({{ month_articles|length }})
+                            </li>
+                        {% endfor %}
+                        </ul>
+                    </li>
+                {% endfor %}
+                </ul>
+            </div>
+        </aside>
+    </div>
+
+    <footer>
+        <div class="container">
+            <p>&copy; {{ SITENAME }}</p>
+        </div>
+    </footer>
+</body>
+</html>
diff --git a/theme/templates/index.html b/theme/templates/index.html
new file mode 100644 (file)
index 0000000..c869d4d
--- /dev/null
@@ -0,0 +1,28 @@
+{% extends "base.html" %}
+
+{% block content %}
+    {% for article in articles_page.object_list %}
+        <article class="post">
+            <h2 class="post-title">
+                <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
+            </h2>
+            <div class="post-meta">
+                <time datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%-d %B %Y') }}</time>
+            </div>
+            <div class="post-content">
+                {{ article.content }}
+            </div>
+        </article>
+    {% endfor %}
+
+    {% if articles_page.has_previous() or articles_page.has_next() %}
+    <nav class="pagination">
+        {% if articles_page.has_previous() %}
+            <a href="{{ SITEURL }}/{{ articles_previous_page.url }}">&larr; Newer</a>
+        {% endif %}
+        {% if articles_page.has_next() %}
+            <a href="{{ SITEURL }}/{{ articles_next_page.url }}">Older &rarr;</a>
+        {% endif %}
+    </nav>
+    {% endif %}
+{% endblock %}