aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2024-01-08 20:11:17 -0600
committerChristian Cleberg <hello@cleberg.net>2024-01-08 20:11:17 -0600
commit25945b8fead989cca09a23983623b63ce36dcc0c (patch)
tree0dfc869ce8b028e04ce9da196af08779780915ce /templates
parent22b526be60bf4257c2a1d58a5fad59cf6b044375 (diff)
downloadcleberg.net-25945b8fead989cca09a23983623b63ce36dcc0c.tar.gz
cleberg.net-25945b8fead989cca09a23983623b63ce36dcc0c.tar.bz2
cleberg.net-25945b8fead989cca09a23983623b63ce36dcc0c.zip
feat: total re-write from Emacs org-mode to Zola markdown
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html44
-rw-r--r--templates/index.html40
-rw-r--r--templates/page.html41
-rw-r--r--templates/section.html18
4 files changed, 143 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..59e8f5e
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>cleberg.net</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ {% if page %}
+ {% if page.description %}
+ <meta name="description" content="{{ page.description }}">
+ {% elif config.description %}
+ <meta name="description" content="{{ config.description }}">
+ {% endif %}
+ {% elif config.description %}
+ <meta name="description" content="{{ config.description }}" />
+ {% endif %}
+
+ {% block rss %}
+ <link rel="alternate" type="application/atom+xml" title="RSS" href="{{ get_url(path="atom.xml", trailing_slash=false) }}">
+ {% endblock %}
+
+ {% block css %}
+ <link rel="stylesheet" href="/styles.css">
+ {% endblock css %}
+
+ {% block extra_head %}{% endblock extra_head %}
+</head>
+<body>
+ <nav class="site-nav">
+ <ul>
+ <li><a href="/">Home</a></li>
+ <li><a href="/blog/">Blog</a></li>
+ <li><a href="/services/">Services</a></li>
+ <li><a href="/wiki/">Wiki</a></li>
+ </ul>
+ </nav>
+
+ <main>{% block content %}{% endblock content %}</main>
+
+ <footer>
+ <p>Last build: {{ now() | date(format="%Y-%m-%d %H:%M:%S") }}</p>
+ <p><a href="https://git.sr.ht/~cyborg/cleberg.net" target="_blank" rel="noopener">Source Code</a></p>
+ <p><a href="/atom.xml">Atom RSS Feed</a></p>
+ </footer>
+</body>
+</html>
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..ff4d20c
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,40 @@
+{% extends "base.html" %}
+
+{% block content %}
+<section>
+ <h1>cleberg.net</h1>
+ <blockquote>Do AIs dream in electric sheep?<br>He hoped it had nanosecond nightmares.</blockquote>
+</section>
+<section>
+ <h2>Recent Blog Posts</h2>
+ {% set section = get_section(path="blog/_index.md") %}
+ {% set i = 0 %}
+ {% for page in section.pages %}
+ {% if i < 3%}
+ {% set_global i = i + 1%}
+ <div class="post">
+ <time datetime="{{ page.date | date(format='%Y-%m-%d %H:%M:%S') }}">{{ page.date }}</time>
+ <a href="/blog/{{ page.slug }}/">{{ page.title }}</a>
+ </div>
+ {% endif %}
+ {% endfor %}
+ <br>
+ <a href="/blog/">Older Posts &rarr;</a>
+</section>
+<section>
+ <h2>Everything Else</h2>
+ <ul>
+ <li><a href="/salary/">Salary</a></li>
+ <li><a href="/services/">Services</a></li>
+ <li><a href="/wiki/">Wiki</a></li>
+ </ul>
+</section>
+<section>
+ <h2>Contact</h2>
+ <ul>
+ <li>hello [at] cleberg.net (<a href="/gpg.txt">GPG</a>)</li>
+ <li><a href="https://matrix.to/#/@cyborg:matrix.tchncs.de" target="_blank" rel="noopener">@cyborg:@matrix.tchncs.de</a></li>
+ <li><a href="https://git.sr.ht/~cyborg/" target="_blank" rel="noopener">Sourcehut</a></li>
+ </ul>
+</section>
+{% endblock content %}
diff --git a/templates/page.html b/templates/page.html
new file mode 100644
index 0000000..f668751
--- /dev/null
+++ b/templates/page.html
@@ -0,0 +1,41 @@
+{% extends "base.html" %}
+
+{% block css %}
+<link rel="stylesheet" href="/syntax-theme-dark.css">
+<link rel="stylesheet" href="/styles.css">
+{% endblock css %}
+
+{% block content %}
+<section class="post-metadata">
+ <h1>{{ page.title }}</h1>
+ {% if page.date %}
+ <p><time datetime="{{ page.date | date(format='%Y-%m-%d %H:%M:%S') }}">{{ page.date }}</time></p>
+ {% endif %}
+ <p>{{ page.word_count }} words; {{ page.reading_time }} minute(s)</p>
+{% if page.toc %}
+ <details open>
+ <summary>Table of Contents</summary>
+ <nav class="page-nav">
+ <ul>
+ {% for h1 in page.toc %}
+ <li>
+ <a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
+ {% if h1.children %}
+ <ul>
+ {% for h2 in h1.children %}
+ <li>
+ <a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ </nav>
+ </details>
+{% endif %}
+</section>
+
+{{ page.content | safe }}
+{% endblock content %}
diff --git a/templates/section.html b/templates/section.html
new file mode 100644
index 0000000..70e8cb1
--- /dev/null
+++ b/templates/section.html
@@ -0,0 +1,18 @@
+{% extends "base.html" %}
+
+{% block content %}
+<h1>{{ section.title }}</h1>
+<p>Use <code>Ctrl + f</code> to search blog post titles for keywords.
+<br>You can also add the <a href="/atom.xml">Atom RSS Feed</a> to your feed reader.</p>
+{% set post_date = "1970-01-01" | date(format="%Y") %}
+{% for page in section.pages %}
+ {% if post_date != page.date | date(format="%Y") %}
+ {% set_global post_date = page.date | date(format="%Y") %}
+ <h2>{{ post_date }}</h2>
+ {% endif %}
+ <div class="post">
+ <time datetime="{{ page.date | date(format='%Y-%m-%d %H:%M:%S') }}">{{ page.date }}</time>
+ <a href="/blog/{{ page.slug }}/">{{ page.title }}</a>
+ </div>
+{% endfor %}
+{% endblock content %}