summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorradhitya <alif@radhitya.org>2026-06-25 22:38:51 +0700
committerradhitya <alif@radhitya.org>2026-06-25 22:51:07 +0700
commitff69f0e9e01d7d90773b2d1c1b339a0c8e1fc806 (patch)
treed39d4093bbfff5e5fb07b2e724452dbafc020ae6 /templates
parent3e5f9473f963d1c33b4d817105ff8f32e32e521a (diff)
done
Diffstat (limited to 'templates')
-rw-r--r--templates/index.html34
-rw-r--r--templates/post.html24
-rw-r--r--templates/search.html36
3 files changed, 94 insertions, 0 deletions
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..f981b3b
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>{{ site.title }}</title>
+<link rel="stylesheet" href="{{ site.url }}style.css">
+</head>
+<body>
+<header>
+ <h1><a href="/">{{ site.title }}</a></h1>
+ <nav><a href="/search/">search</a></nav>
+</header>
+<main>
+{% if intro %}<section class="intro">{{ intro }}</section>{% endif %}
+<ul class="post-list">
+{% for post in posts %}
+ <li>
+ <span class="date">{{ post.date }}</span>
+ <a href="/{{ post.slug }}/">{{ post.title }}</a>
+ </li>
+{% endfor %}
+</ul>
+{% if total_pages > 1 %}
+<nav class="pagination">
+ <span>{% if has_prev %}<a href="{{ prev_url }}">← newer</a>{% else %}<span class="disabled">← newer</span>{% endif %}</span>
+ <span class="info">page {{ page }} of {{ total_pages }}</span>
+ <span>{% if has_next %}<a href="{{ next_url }}">older →</a>{% else %}<span class="disabled">older →</span>{% endif %}</span>
+</nav>
+{% endif %}
+</main>
+<footer><p>{{ site.author }}</p></footer>
+</body>
+</html>
diff --git a/templates/post.html b/templates/post.html
new file mode 100644
index 0000000..531ea63
--- /dev/null
+++ b/templates/post.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>{{ title }} — {{ site.title }}</title>
+<link rel="stylesheet" href="{{ site.url }}style.css">
+</head>
+<body>
+<header>
+ <h1><a href="/">{{ site.title }}</a></h1>
+ <nav><a href="/search/">search</a></nav>
+</header>
+<main>
+ <article>
+ <h1>{{ title }}</h1>
+ <span class="meta">{{ date }}{% if draft %} ◈ draft{% endif %}</span>
+ {{ body }}
+ </article>
+ <p><a href="/">← back</a></p>
+</main>
+<footer><p>{{ site.author }}</p></footer>
+</body>
+</html>
diff --git a/templates/search.html b/templates/search.html
new file mode 100644
index 0000000..b022c8d
--- /dev/null
+++ b/templates/search.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>Search — {{ site.title }}</title>
+<link rel="stylesheet" href="{{ site.url }}style.css">
+</head>
+<body>
+<header>
+ <h1><a href="/">{{ site.title }}</a></h1>
+ <nav><a href="/">home</a></nav>
+</header>
+<main>
+ <input type="search" id="q" placeholder="search posts..." autofocus>
+ <ul id="results" class="post-list"></ul>
+</main>
+<footer><p>{{ site.author }}</p></footer>
+<script>
+var idx = [];
+fetch("/search.json").then(function(r){return r.json()}).then(function(d){idx=d});
+document.getElementById("q").addEventListener("input", function(){
+ var q = this.value.toLowerCase().trim();
+ var html = "";
+ if (q.length < 2) { document.getElementById("results").innerHTML = ""; return; }
+ for (var i = 0; i < idx.length; i++) {
+ var p = idx[i];
+ if (p.title.toLowerCase().indexOf(q) >= 0 || p.text.toLowerCase().indexOf(q) >= 0) {
+ html += '<li><h2><a href="/' + p.slug + '/">' + p.title + '</a></h2><span class="meta">' + p.date + '</span></li>';
+ }
+ }
+ document.getElementById("results").innerHTML = html || "<li class='none'>no results</li>";
+});
+</script>
+</body>
+</html>