git ssb

0+

Grey the earthling / gkn.me.uk



Commit dfa263b68c7644035d15afa896a0b04e59f2a3f5

Add classes to nearby <li>

Position <li> on the grid in the wide layout.
Fixes the layout for the first entry.
Greg K Nicholson committed on 2/16/2018, 7:14:14 PM
Parent: eb7713aa95a037673eca630953d54d05cdb76221

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,15 +158,31 @@
158158 display: block;
159159 margin-top: 1rem;
160160 }
161161
162- nav.nearby li,
163- nav.nearby ul {
162 + nav.nearby ul,
163 + nav.nearby li {
164164 display: inline;
165165 margin: 0;
166166 padding: 0;
167167 }
168168
169 + nav.nearby li {
170 + grid-row: 1/2;
171 + }
172 +
173 + nav.nearby li.up {
174 + grid-column: 2/3;
175 + }
176 +
177 + nav.nearby li.next {
178 + grid-column: 3/4;
179 + }
180 +
181 + nav.nearby li.prev {
182 + grid-column: 1/2;
183 + }
184 +
169185 nav.nearby a {
170186 display: block;
171187 margin-top: 1rem;
172188 margin-right: 1rem;
themes/ran/templates/article.htmlView
@@ -155,23 +155,23 @@
155155 {%- endif -%}
156156 <nav class="nearby">
157157 <ul>
158158 {%- if article.prev_article -%}
159- <li>
159 + <li class="prev">
160160 <a href="/{{- article.prev_article.url -}}" rel="prev">
161161 <span></span>
162162 {{- article.prev_article.title | trim -}}
163163 </a>
164164 </li>
165165 {%- endif -%}
166- <li>
166 + <li class="up">
167167 <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up">
168168 <span></span>
169169 {{- article.date | strftime(DATE_FORMAT_DAY) -}}
170170 </a>
171171 </li>
172172 {%- if article.next_article -%}
173- <li>
173 + <li class="next">
174174 <a href="/{{- article.next_article.url -}}" rel="next">
175175 <span></span>
176176 {{- article.next_article.title | trim -}}
177177 </a>
themes/ran/templates/period_archives.htmlView
@@ -62,9 +62,9 @@
6262 selectattr("date", "lessthan",
6363 dates[ dates | length - 1].date) -%}
6464 {%- if loop.index == 1 -%}
6565 {%- if period | length == 1 -%}
66- <li>
66 + <li class="prev">
6767 <a href="/{{- article.date | strftime('%Y') -}}"
6868 rel="prev">
6969 <span></span>
7070 <time datetime="{{- article.date |
@@ -74,9 +74,9 @@
7474 </time>
7575 </a>
7676 </li>
7777 {%- elif period | length == 2 -%}
78- <li>
78 + <li class="prev">
7979 <a href="/{{- article.date | strftime('%Y/%m') -}}"
8080 rel="prev">
8181 <span></span>
8282 <time datetime="{{- article.date |
@@ -86,9 +86,9 @@
8686 </time>
8787 </a>
8888 </li>
8989 {%- else -%}
90- <li>
90 + <li class="prev">
9191 <a href="/{{- article.date |
9292 strftime('%Y/%m/%d') -}}"
9393 rel="prev">
9494 <span></span>
@@ -102,25 +102,25 @@
102102 {%- endif -%}
103103 {%- endif -%}
104104 {%- endfor -%}
105105 {%- if period | length == 1 -%}
106- <li>
106 + <li class="up">
107107 <a href="/entries" rel="up">
108108 <span></span>
109109 {{- ARCHIVES_TITLE -}}
110110 </a>
111111 </li>
112112 {%- elif period | length == 2 -%}
113- <li>
113 + <li class="up">
114114 <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up">
115115 <span></span>
116116 <time datetime="{{- dates[0].date | strftime('%Y') -}}">
117117 {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}}
118118 </time>
119119 </a>
120120 </li>
121121 {%- else -%}
122- <li>
122 + <li class="up">
123123 <a href="/{{- dates[0].date | strftime('%Y/%m') -}}"
124124 rel="up">
125125 <span></span>
126126 <time datetime="{{- dates[0].date |
@@ -134,9 +134,9 @@
134134 selectattr("date", "greaterthan", dates[0].date) |
135135 reverse -%}
136136 {%- if loop.index == 1 -%}
137137 {%- if period | length == 1 -%}
138- <li>
138 + <li class="next">
139139 <a href="/{{- article.date | strftime('%Y') -}}"
140140 rel="next">
141141 <span></span>
142142 <time datetime="{{- article.date |
@@ -146,9 +146,9 @@
146146 </time>
147147 </a>
148148 </li>
149149 {%- elif period | length == 2 -%}
150- <li>
150 + <li class="next">
151151 <a href="/{{- article.date | strftime('%Y/%m') -}}"
152152 rel="next">
153153 <span></span>
154154 <time datetime="{{- article.date |
@@ -158,9 +158,9 @@
158158 </time>
159159 </a>
160160 </li>
161161 {%- else -%}
162- <li>
162 + <li class="next">
163163 <a href="/{{- article.date |
164164 strftime('%Y/%m/%d') -}}"
165165 rel="next">
166166 <span></span>
themes/ran/templates/tag.htmlView
@@ -13,17 +13,17 @@
1313 {%- for othertag, otherarticles in tags | sort | reverse if
1414 othertag.slug < tag.slug and
1515 otherarticles | list | length > 1 -%}
1616 {%- if loop.index == 1 -%}
17- <li>
17 + <li class="prev">
1818 <a href="/entries/{{- othertag.slug -}}" rel="prev">
1919 <span></span>
2020 {{- othertag -}}
2121 </a>
2222 </li>
2323 {%- endif -%}
2424 {%- endfor -%}
25- <li>
25 + <li class="up">
2626 <a href="/entries" rel="up">
2727 <span></span>
2828 {{- ARCHIVES_TITLE -}}
2929 </a>
@@ -31,9 +31,9 @@
3131 {%- for othertag, otherarticles in tags | sort if
3232 othertag.slug > tag.slug and
3333 otherarticles | list | length > 1 -%}
3434 {%- if loop.index == 1 %}
35- <li>
35 + <li class="next">
3636 <a href="/entries/{{- othertag.slug -}}" rel="next">
3737 <span></span>
3838 {{- othertag -}}
3939 </a>

Built with git-ssb-web