git ssb

0+

Grey the earthling / gkn.me.uk



Commit 2a2b9271cfb5614e3cbf6c6b3ff2f4b127e8abe9

Structure nearby links as lists

Improves the structure in text-mode browsers.

Still need to fix the graphical layout.
Greg K Nicholson committed on 2/14/2018, 10:38:30 PM
Parent: df0e7a9773f81ffdb5ca791b59efe420377ce1bf

Files changed

themes/ran/templates/article.htmlchanged
themes/ran/templates/period_archives.htmlchanged
themes/ran/templates/tag.htmlchanged
themes/ran/templates/article.htmlView
@@ -148,24 +148,32 @@
148148 {%- endfor -%}
149149 </ul>
150150 {%- endif -%}
151151 <nav class="nearby">
152- <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up">
153- <span></span>
154- {{- article.date | strftime(DATE_FORMAT_DAY) -}}
155- </a>
156- {%- if article.next_article -%}
157- <a href="/{{- article.next_article.url -}}" rel="next">
158- <span></span>
159- {{- article.next_article.title | trim -}}
160- </a>
161- {%- endif -%}
162- {%- if article.prev_article -%}
163- <a href="/{{- article.prev_article.url -}}" rel="prev">
164- <span></span>
165- {{- article.prev_article.title | trim -}}
166- </a>
167- {%- endif -%}
152 + <ul>
153 + <li>
154 + <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up">
155 + <span></span>
156 + {{- article.date | strftime(DATE_FORMAT_DAY) -}}
157 + </a>
158 + </li>
159 + {%- if article.next_article -%}
160 + <li>
161 + <a href="/{{- article.next_article.url -}}" rel="next">
162 + <span></span>
163 + {{- article.next_article.title | trim -}}
164 + </a>
165 + </li>
166 + {%- endif -%}
167 + {%- if article.prev_article -%}
168 + <li>
169 + <a href="/{{- article.prev_article.url -}}" rel="prev">
170 + <span></span>
171 + {{- article.prev_article.title | trim -}}
172 + </a>
173 + </li>
174 + {%- endif -%}
175 + </ul>
168176 </nav>
169177 {{- super() -}}
170178 {%- endblock -%}
171179
themes/ran/templates/period_archives.htmlView
@@ -56,91 +56,126 @@
5656 {%- endif -%}
5757 {%- endblock -%}
5858 {%- block maincontent -%}
5959 <nav class="nearby">
60- {%- if period | length == 1 -%}
61- <a href="/entries" rel="up">
62- <span></span>
63- {{- ARCHIVES_TITLE -}}
64- </a>
65- {%- elif period | length == 2 -%}
66- <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up">
67- <span></span>
68- <time datetime="{{- dates[0].date | strftime('%Y') -}}">
69- {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}}
70- </time>
71- </a>
72- {%- else -%}
73- <a href="/{{- dates[0].date | strftime('%Y/%m') -}}" rel="up">
74- <span></span>
75- <time datetime="{{- dates[0].date | strftime('%Y-%m') -}}">
76- {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}}
77- </time>
78- </a>
79- {%- endif -%}
80- {%- for article in articles |
81- selectattr("date", "greaterthan", dates[0].date) |
82- reverse -%}
83- {%- if loop.index == 1 -%}
84- {%- if period | length == 1 -%}
85- <a href="/{{- article.date | strftime('%Y') -}}" rel="next">
86- <span></span>
87- <time datetime="{{- article.date | strftime('%Y') -}}">
88- {{- article.date | strftime(DATE_FORMAT_YEAR) -}}
60 + <ul>
61 + {%- if period | length == 1 -%}
62 + <li>
63 + <a href="/entries" rel="up">
64 + <span></span>
65 + {{- ARCHIVES_TITLE -}}
66 + </a>
67 + </li>
68 + {%- elif period | length == 2 -%}
69 + <li>
70 + <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up">
71 + <span></span>
72 + <time datetime="{{- dates[0].date | strftime('%Y') -}}">
73 + {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}}
8974 </time>
9075 </a>
91- {%- elif period | length == 2 -%}
92- <a href="/{{- article.date | strftime('%Y/%m') -}}"
93- rel="next">
94- <span></span>
95- <time datetime="{{- article.date |
76 + </li>
77 + {%- else -%}
78 + <li>
79 + <a href="/{{- dates[0].date | strftime('%Y/%m') -}}"
80 + rel="up">
81 + <span></span>
82 + <time datetime="{{- dates[0].date |
9683 strftime('%Y-%m') -}}">
97- {{- article.date | strftime(DATE_FORMAT_MONTH) -}}
84 + {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}}
9885 </time>
9986 </a>
100- {%- else -%}
101- <a href="/{{- article.date | strftime('%Y/%m/%d') -}}"
102- rel="next">
103- <span></span>
104- <time datetime="{{- article.date |
105- strftime('%Y-%m-%d') -}}">
106- {{- article.date | strftime(DATE_FORMAT_DAY) -}}
107- </time>
108- </a>
109- {%- endif -%}
87 + </li>
11088 {%- endif -%}
111- {%- endfor -%}
112- {%- for article in articles |
113- selectattr("date", "lessthan", dates[ dates | length - 1].date) -%}
114- {%- if loop.index == 1 -%}
115- {%- if period | length == 1 -%}
116- <a href="/{{- article.date | strftime('%Y') -}}" rel="prev">
117- <span></span>
118- <time datetime="{{- article.date | strftime('%Y') -}}">
119- {{- article.date | strftime(DATE_FORMAT_YEAR) -}}
120- </time>
121- </a>
122- {%- elif period | length == 2 -%}
123- <a href="/{{- article.date | strftime('%Y/%m') -}}"
124- rel="prev">
125- <span></span>
126- <time datetime="{{- article.date |
127- strftime('%Y-%m') -}}">
128- {{- article.date | strftime(DATE_FORMAT_MONTH) -}}
129- </time>
130- </a>
131- {%- else -%}
132- <a href="/{{- article.date | strftime('%Y/%m/%d') -}}"
133- rel="prev">
134- <span></span>
135- <time datetime="{{- article.date |
136- strftime('%Y-%m-%d') -}}">
137- {{- article.date | strftime(DATE_FORMAT_DAY) -}}
138- </time>
139- </a>
89 + {%- for article in articles |
90 + selectattr("date", "greaterthan", dates[0].date) |
91 + reverse -%}
92 + {%- if loop.index == 1 -%}
93 + {%- if period | length == 1 -%}
94 + <li>
95 + <a href="/{{- article.date | strftime('%Y') -}}"
96 + rel="next">
97 + <span></span>
98 + <time datetime="{{- article.date |
99 + strftime('%Y') -}}">
100 + {{- article.date |
101 + strftime(DATE_FORMAT_YEAR) -}}
102 + </time>
103 + </a>
104 + </li>
105 + {%- elif period | length == 2 -%}
106 + <li>
107 + <a href="/{{- article.date | strftime('%Y/%m') -}}"
108 + rel="next">
109 + <span></span>
110 + <time datetime="{{- article.date |
111 + strftime('%Y-%m') -}}">
112 + {{- article.date |
113 + strftime(DATE_FORMAT_MONTH) -}}
114 + </time>
115 + </a>
116 + </li>
117 + {%- else -%}
118 + <li>
119 + <a href="/{{- article.date |
120 + strftime('%Y/%m/%d') -}}"
121 + rel="next">
122 + <span></span>
123 + <time datetime="{{- article.date |
124 + strftime('%Y-%m-%d') -}}">
125 + {{- article.date |
126 + strftime(DATE_FORMAT_DAY) -}}
127 + </time>
128 + </a>
129 + </li>
130 + {%- endif -%}
140131 {%- endif -%}
141- {%- endif -%}
142- {%- endfor -%}
132 + {%- endfor -%}
133 + {%- for article in articles |
134 + selectattr("date", "lessthan",
135 + dates[ dates | length - 1].date) -%}
136 + {%- if loop.index == 1 -%}
137 + {%- if period | length == 1 -%}
138 + <li>
139 + <a href="/{{- article.date | strftime('%Y') -}}"
140 + rel="prev">
141 + <span></span>
142 + <time datetime="{{- article.date |
143 + strftime('%Y') -}}">
144 + {{- article.date |
145 + strftime(DATE_FORMAT_YEAR) -}}
146 + </time>
147 + </a>
148 + </li>
149 + {%- elif period | length == 2 -%}
150 + <li>
151 + <a href="/{{- article.date | strftime('%Y/%m') -}}"
152 + rel="prev">
153 + <span></span>
154 + <time datetime="{{- article.date |
155 + strftime('%Y-%m') -}}">
156 + {{- article.date |
157 + strftime(DATE_FORMAT_MONTH) -}}
158 + </time>
159 + </a>
160 + </li>
161 + {%- else -%}
162 + <li>
163 + <a href="/{{- article.date |
164 + strftime('%Y/%m/%d') -}}"
165 + rel="prev">
166 + <span></span>
167 + <time datetime="{{- article.date |
168 + strftime('%Y-%m-%d') -}}">
169 + {{- article.date |
170 + strftime(DATE_FORMAT_DAY) -}}
171 + </time>
172 + </a>
173 + </li>
174 + {%- endif -%}
175 + {%- endif -%}
176 + {%- endfor -%}
177 + </ul>
143178 </nav>
144179 {{- super() -}}
145180 {%- endblock -%}
146181
themes/ran/templates/tag.htmlView
@@ -8,32 +8,40 @@
88 title="{{ SITENAME }} - {{ tag }}">
99 {% endblock %}
1010 {% block maincontent %}
1111 <nav class="nearby">
12- <a href="/entries" rel="up">
13- <span></span>
14- {{- ARCHIVES_TITLE -}}
15- </a>
16- {%- for othertag, otherarticles in tags | sort if
17- othertag.slug > tag.slug and
18- otherarticles | list | length > 1 -%}
19- {%- if loop.index == 1 %}
20- <a href="/entries/{{- othertag.slug -}}" rel="next">
21- <span></span>
22- {{- othertag -}}
12 + <ul>
13 + <li>
14 + <a href="/entries" rel="up">
15 + <span></span>
16 + {{- ARCHIVES_TITLE -}}
2317 </a>
24- {%- endif -%}
25- {%- endfor -%}
26- {%- for othertag, otherarticles in tags | sort | reverse if
27- othertag.slug < tag.slug and
28- otherarticles | list | length > 1 -%}
29- {%- if loop.index == 1 -%}
30- <a href="/entries/{{- othertag.slug -}}" rel="prev">
31- <span></span>
32- {{- othertag -}}
33- </a>
34- {%- endif -%}
35- {%- endfor -%}
18 + </li>
19 + {%- for othertag, otherarticles in tags | sort if
20 + othertag.slug > tag.slug and
21 + otherarticles | list | length > 1 -%}
22 + {%- if loop.index == 1 %}
23 + <li>
24 + <a href="/entries/{{- othertag.slug -}}" rel="next">
25 + <span></span>
26 + {{- othertag -}}
27 + </a>
28 + </li>
29 + {%- endif -%}
30 + {%- endfor -%}
31 + {%- for othertag, otherarticles in tags | sort | reverse if
32 + othertag.slug < tag.slug and
33 + otherarticles | list | length > 1 -%}
34 + {%- if loop.index == 1 -%}
35 + <li>
36 + <a href="/entries/{{- othertag.slug -}}" rel="prev">
37 + <span></span>
38 + {{- othertag -}}
39 + </a>
40 + </li>
41 + {%- endif -%}
42 + {%- endfor -%}
43 + </ul>
3644 </nav>
3745 {{- super() -}}
3846 {% endblock %}
3947

Built with git-ssb-web