git ssb

0+

Grey the earthling / gkn.me.uk



Commit bc053b6965c90204a51bed73a870fe3c2b42c424

Home page: allow list of entries to expand

Instead of always showing only the first 3 entries,
(plus the bio),
also show any older entries from the same month as the 3rd entry.

This allows the list to expand
when there are many entries in quick succession.

I'd like to be able to show any entries newer than n days ago,
but I haven't worked out how to add or subtract from a date
before comparing against it.
Greg K Nicholson committed on 2/26/2018, 12:18:06 AM
Parent: 9c3c14e63d6a6b81238b18f9ad401b74f6145862

Files changed

themes/ran/templates/index.htmlchanged
themes/ran/templates/index.htmlView
@@ -9,9 +9,15 @@
99 {%- endblock -%}
1010 {%- block maincontent -%}
1111 <ul class="biglinks">
1212 {%- for article in dates -%}
13- {%- if loop.index <= 3 or article.slug == AUTHOR_URL -%}
13 + {%- if article.slug == AUTHOR_URL
14 + or article.date | strftime('%Y-%m') >=
15 + articles[2].date | strftime('%Y-%m') -%}
16 + {# <!-- Show the bio,
17 + plus the first 3 entries (0 to 2),
18 + plus any other entries in the same month
19 + as the 3rd entry. --> #}
1420 {{- entry_link(article) -}}
1521 {%- endif -%}
1622 {%- endfor -%}
1723 <li>

Built with git-ssb-web