summaryrefslogtreecommitdiff
path: root/index.html.tmpl
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-07-12 20:00:15 -0600
committert <t@tjp.lol>2026-07-12 20:03:27 -0600
commit0e602cfa7881f789c3e9f1d5f25db9a8179cd0fc (patch)
tree059b4c6761f3f61bc202ed5e685791b96be0074a /index.html.tmpl
parent92bd4424db18b10ec28653ba6c20efe22ef1637b (diff)
site updates
Diffstat (limited to 'index.html.tmpl')
-rw-r--r--index.html.tmpl27
1 files changed, 19 insertions, 8 deletions
diff --git a/index.html.tmpl b/index.html.tmpl
index 59a87e3..7d2376a 100644
--- a/index.html.tmpl
+++ b/index.html.tmpl
@@ -24,19 +24,30 @@
</section>
<section>
- <h2 class="sec">recent posts</h2>
- {{$posts := sortPages (index .Pages "weblog") "post_date"}}{{with $posts}}<ul class="posts">
- {{range slicePages . 0 5}}<li><time datetime="{{date (index .Meta "post_date") "2006-01-02"}}">{{date (index .Meta "post_date") "2006-01-02"}}</time><a href="{{rel "index.html" .OutputPath}}">{{.Title}}</a></li>{{end}}
+ <h2>recent posts</h2>
+ {{- $posts := sortPages (index .Pages "weblog") "post_date" "mod_time"}}
+ {{- with $posts}}
+ <ul class="posts">
+ {{- range slicePages . 0 5}}
+ {{- $post_date := or (index .Meta "post_date") .ModTime}}
+ <li><time datetime="{{date $post_date "2006-01-02"}}">{{date $post_date "2006-01-02"}}</time><a href="{{rel "index.html" .OutputPath}}">{{.Title}}</a></li>
+ {{- end}}
</ul>
- {{end}}<p style="margin-top:.9rem;font-size:.9rem;"><a href="/weblog/">all posts &rarr;</a></p>
+ {{- end}}
+ <p style="margin-top:.9rem;font-size:.9rem;"><a href="/weblog/">all posts &rarr;</a></p>
</section>
<section>
- <h2 class="sec">recently changed notes</h2>
- {{$notes := sortPages (index .Pages "notes") "ModTime"}}{{with $notes}}<ul>
- {{range slicePages . 0 5}}<li><a href="{{rel "index.html" .OutputPath}}">{{.Title}}</a></li>{{end}}
+ <h2>recently changed notes</h2>
+ {{- $notes := sortPages (index .Pages "notes") "ModTime"}}
+ {{- with $notes}}
+ <ul>
+ {{- range slicePages . 0 5}}
+ <li><a href="{{rel "index.html" .OutputPath}}">{{.Title}}</a></li>
+ {{- end}}
</ul>
- {{end}}<p style="margin-top:.9rem;font-size:.9rem;"><a href="/notes/">notes &rarr;</a></p>
+ {{- end}}
+ <p style="margin-top:.9rem;font-size:.9rem;"><a href="/notes/">notes &rarr;</a></p>
</section>
</main>