diff options
Diffstat (limited to 'index.html.tmpl')
| -rw-r--r-- | index.html.tmpl | 27 |
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 →</a></p> + {{- end}} + <p style="margin-top:.9rem;font-size:.9rem;"><a href="/weblog/">all posts →</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 →</a></p> + {{- end}} + <p style="margin-top:.9rem;font-size:.9rem;"><a href="/notes/">notes →</a></p> </section> </main> |
