git ssb

0+

Grey the earthling / gkn.me.uk



Commit 7222b6b0d7d5b4564ab2f0d1b28ed8a1a81afda6

Merge branch 'nearby' into plain

Greg K Nicholson committed on 2/16/2018, 11:41:11 AM
Parent: 263dcac6d85effcc6f97824bc6bc03a86122b31f
Parent: 9e8c00eafa3d6d94f2b92037243fe07b6ba66aad

Files changed

themes/ran/static/style/ran.csschanged
themes/ran/templates/article.htmlchanged
themes/ran/templates/period_archives.htmlchanged
themes/ran/templates/tag.htmlchanged
themes/ran/static/style/ran.cssView
@@ -158,8 +158,15 @@
158158 display: block;
159159 margin-top: 1rem;
160160 }
161161
162 + nav.nearby li,
163 + nav.nearby ul {
164 + display: inline;
165 + margin: 0;
166 + padding: 0;
167 + }
168 +
162169 nav.nearby a {
163170 display: block;
164171 margin-top: 1rem;
165172 margin-right: 1rem;
@@ -183,16 +190,15 @@
183190 content: "← ";
184191 }
185192
186193 @media (min-width: 42rem) {
187- nav.nearby {
194 + nav.nearby ul {
188195 display: grid;
189196 grid-template-columns: 1fr 1fr 1fr;
190197 margin-right:0;
191198 }
192199
193200 nav.nearby a {
194- grid-row: 1/2;
195201 margin-top: 0;
196202 margin-right: 0;
197203 text-align: center;
198204 }
@@ -201,19 +207,16 @@
201207 width: 100%;
202208 }
203209
204210 nav.nearby a[rel="up"] {
205- grid-column: 2/3;
206211 text-align: center;
207212 }
208213
209214 nav.nearby a[rel="next"] {
210- grid-column: 3/4;
211215 text-align: right;
212216 }
213217
214218 nav.nearby a[rel="prev"] {
215- grid-column: 1/2;
216219 text-align: left;
217220 }
218221 }
219222
themes/ran/templates/article.htmlView
@@ -149,24 +149,32 @@
149149 {%- endfor -%}
150150 </ul>
151151 {%- endif -%}
152152 <nav class="nearby">
153- <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up">
154- <span></span>
155- {{- article.date | strftime(DATE_FORMAT_DAY) -}}
156- </a>
157- {%- if article.next_article -%}
158- <a href="/{{- article.next_article.url -}}" rel="next">
159- <span></span>
160- {{- article.next_article.title | trim -}}
161- </a>
162- {%- endif -%}
163- {%- if article.prev_article -%}
164- <a href="/{{- article.prev_article.url -}}" rel="prev">
165- <span></span>
166- {{- article.prev_article.title | trim -}}
167- </a>
168- {%- endif -%}
153 + <ul>
154 + {%- if article.prev_article -%}
155 + <li>
156 + <a href="/{{- article.prev_article.url -}}" rel="prev">
157 + <span></span>
158 + {{- article.prev_article.title | trim -}}
159 + </a>
160 + </li>
161 + {%- endif -%}
162 + <li>
163 + <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up">
164 + <span></span>
165 + {{- article.date | strftime(DATE_FORMAT_DAY) -}}
166 + </a>
167 + </li>
168 + {%- if article.next_article -%}
169 + <li>
170 + <a href="/{{- article.next_article.url -}}" rel="next">
171 + <span></span>
172 + {{- article.next_article.title | trim -}}
173 + </a>
174 + </li>
175 + {%- endif -%}
176 + </ul>
169177 </nav>
170178 {{- super() -}}
171179 {%- endblock -%}
172180
themes/ran/templates/period_archives.htmlView
@@ -58,91 +58,126 @@
5858 {%- endif -%}
5959 {%- endblock -%}
6060 {%- block maincontent -%}
6161 <nav class="nearby">
62- {%- if period | length == 1 -%}
63- <a href="/entries" rel="up">
64- <span></span>
65- {{- ARCHIVES_TITLE -}}
66- </a>
67- {%- elif period | length == 2 -%}
68- <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up">
69- <span></span>
70- <time datetime="{{- dates[0].date | strftime('%Y') -}}">
71- {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}}
72- </time>
73- </a>
74- {%- else -%}
75- <a href="/{{- dates[0].date | strftime('%Y/%m') -}}" rel="up">
76- <span></span>
77- <time datetime="{{- dates[0].date | strftime('%Y-%m') -}}">
78- {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}}
79- </time>
80- </a>
81- {%- endif -%}
82- {%- for article in articles |
83- selectattr("date", "greaterthan", dates[0].date) |
84- reverse -%}
85- {%- if loop.index == 1 -%}
86- {%- if period | length == 1 -%}
87- <a href="/{{- article.date | strftime('%Y') -}}" rel="next">
88- <span></span>
89- <time datetime="{{- article.date | strftime('%Y') -}}">
90- {{- article.date | strftime(DATE_FORMAT_YEAR) -}}
62 + <ul>
63 + {%- for article in articles |
64 + selectattr("date", "lessthan",
65 + dates[ dates | length - 1].date) -%}
66 + {%- if loop.index == 1 -%}
67 + {%- if period | length == 1 -%}
68 + <li>
69 + <a href="/{{- article.date | strftime('%Y') -}}"
70 + rel="prev">
71 + <span></span>
72 + <time datetime="{{- article.date |
73 + strftime('%Y') -}}">
74 + {{- article.date |
75 + strftime(DATE_FORMAT_YEAR) -}}
76 + </time>
77 + </a>
78 + </li>
79 + {%- elif period | length == 2 -%}
80 + <li>
81 + <a href="/{{- article.date | strftime('%Y/%m') -}}"
82 + rel="prev">
83 + <span></span>
84 + <time datetime="{{- article.date |
85 + strftime('%Y-%m') -}}">
86 + {{- article.date |
87 + strftime(DATE_FORMAT_MONTH) -}}
88 + </time>
89 + </a>
90 + </li>
91 + {%- else -%}
92 + <li>
93 + <a href="/{{- article.date |
94 + strftime('%Y/%m/%d') -}}"
95 + rel="prev">
96 + <span></span>
97 + <time datetime="{{- article.date |
98 + strftime('%Y-%m-%d') -}}">
99 + {{- article.date |
100 + strftime(DATE_FORMAT_DAY) -}}
101 + </time>
102 + </a>
103 + </li>
104 + {%- endif -%}
105 + {%- endif -%}
106 + {%- endfor -%}
107 + {%- if period | length == 1 -%}
108 + <li>
109 + <a href="/entries" rel="up">
110 + <span></span>
111 + {{- ARCHIVES_TITLE -}}
112 + </a>
113 + </li>
114 + {%- elif period | length == 2 -%}
115 + <li>
116 + <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up">
117 + <span></span>
118 + <time datetime="{{- dates[0].date | strftime('%Y') -}}">
119 + {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}}
91120 </time>
92121 </a>
93- {%- elif period | length == 2 -%}
94- <a href="/{{- article.date | strftime('%Y/%m') -}}"
95- rel="next">
96- <span></span>
97- <time datetime="{{- article.date |
122 + </li>
123 + {%- else -%}
124 + <li>
125 + <a href="/{{- dates[0].date | strftime('%Y/%m') -}}"
126 + rel="up">
127 + <span></span>
128 + <time datetime="{{- dates[0].date |
98129 strftime('%Y-%m') -}}">
99- {{- article.date | strftime(DATE_FORMAT_MONTH) -}}
130 + {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}}
100131 </time>
101132 </a>
102- {%- else -%}
103- <a href="/{{- article.date | strftime('%Y/%m/%d') -}}"
104- rel="next">
105- <span></span>
106- <time datetime="{{- article.date |
107- strftime('%Y-%m-%d') -}}">
108- {{- article.date | strftime(DATE_FORMAT_DAY) -}}
109- </time>
110- </a>
111- {%- endif -%}
133 + </li>
112134 {%- endif -%}
113- {%- endfor -%}
114- {%- for article in articles |
115- selectattr("date", "lessthan", dates[ dates | length - 1].date) -%}
116- {%- if loop.index == 1 -%}
117- {%- if period | length == 1 -%}
118- <a href="/{{- article.date | strftime('%Y') -}}" rel="prev">
119- <span></span>
120- <time datetime="{{- article.date | strftime('%Y') -}}">
121- {{- article.date | strftime(DATE_FORMAT_YEAR) -}}
122- </time>
123- </a>
124- {%- elif period | length == 2 -%}
125- <a href="/{{- article.date | strftime('%Y/%m') -}}"
126- rel="prev">
127- <span></span>
128- <time datetime="{{- article.date |
129- strftime('%Y-%m') -}}">
130- {{- article.date | strftime(DATE_FORMAT_MONTH) -}}
131- </time>
132- </a>
133- {%- else -%}
134- <a href="/{{- article.date | strftime('%Y/%m/%d') -}}"
135- rel="prev">
136- <span></span>
137- <time datetime="{{- article.date |
138- strftime('%Y-%m-%d') -}}">
139- {{- article.date | strftime(DATE_FORMAT_DAY) -}}
140- </time>
141- </a>
135 + {%- for article in articles |
136 + selectattr("date", "greaterthan", dates[0].date) |
137 + reverse -%}
138 + {%- if loop.index == 1 -%}
139 + {%- if period | length == 1 -%}
140 + <li>
141 + <a href="/{{- article.date | strftime('%Y') -}}"
142 + rel="next">
143 + <span></span>
144 + <time datetime="{{- article.date |
145 + strftime('%Y') -}}">
146 + {{- article.date |
147 + strftime(DATE_FORMAT_YEAR) -}}
148 + </time>
149 + </a>
150 + </li>
151 + {%- elif period | length == 2 -%}
152 + <li>
153 + <a href="/{{- article.date | strftime('%Y/%m') -}}"
154 + rel="next">
155 + <span></span>
156 + <time datetime="{{- article.date |
157 + strftime('%Y-%m') -}}">
158 + {{- article.date |
159 + strftime(DATE_FORMAT_MONTH) -}}
160 + </time>
161 + </a>
162 + </li>
163 + {%- else -%}
164 + <li>
165 + <a href="/{{- article.date |
166 + strftime('%Y/%m/%d') -}}"
167 + rel="next">
168 + <span></span>
169 + <time datetime="{{- article.date |
170 + strftime('%Y-%m-%d') -}}">
171 + {{- article.date |
172 + strftime(DATE_FORMAT_DAY) -}}
173 + </time>
174 + </a>
175 + </li>
176 + {%- endif -%}
142177 {%- endif -%}
143- {%- endif -%}
144- {%- endfor -%}
178 + {%- endfor -%}
179 + </ul>
145180 </nav>
146181 {{- super() -}}
147182 {%- endblock -%}
148183
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 + {%- for othertag, otherarticles in tags | sort | reverse if
14 + othertag.slug < tag.slug and
15 + otherarticles | list | length > 1 -%}
16 + {%- if loop.index == 1 -%}
17 + <li>
18 + <a href="/entries/{{- othertag.slug -}}" rel="prev">
19 + <span></span>
20 + {{- othertag -}}
21 + </a>
22 + </li>
23 + {%- endif -%}
24 + {%- endfor -%}
25 + <li>
26 + <a href="/entries" rel="up">
27 + <span></span>
28 + {{- ARCHIVES_TITLE -}}
2329 </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 -%}
30 + </li>
31 + {%- for othertag, otherarticles in tags | sort 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="next">
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