Files: 9eb6ce65d134137a04464ae64c144236be1fd2b3 / themes / ran / templates / article.html
5134 bytesRaw
1 | {%- extends "base.html" -%} |
2 | {%- block title -%}{{- article.title | trim -}}{%- endblock -%} |
3 | {%- block head -%} |
4 | {{- super() -}} |
5 | {%- for tag in article.tags -%} |
6 | {%- for anytag, articles in tags if |
7 | anytag == tag and |
8 | articles | list | length > 1 -%} |
9 | <link href="/entries/{{- tag.slug -}}/feed" |
10 | rel="alternate" |
11 | type="application/atom+xml" |
12 | title="{{ SITENAME }} - {{ tag }}"> |
13 | {%- endfor -%} |
14 | {%- endfor -%} |
15 | {% endblock %} |
16 | {%- block pagedetails -%} |
17 | {%- for author in article.authors -%} |
18 | <address> |
19 | <span>by </span> |
20 | <a href="/{{- article.author.url -}}" rel="author"> |
21 | {{- article.author | trim -}} |
22 | </a> |
23 | </address> |
24 | {%- endfor -%} |
25 | <p> |
26 | <time datetime="{{- article.date | strftime('%Y-%m-%d %H:%M') -}}"> |
27 | {{- article.date | strftime(DATE_FORMAT_MINUTE) -}} |
28 | </time> |
29 | {%- if article.modified and |
30 | article.date | strftime(DATE_FORMAT_DAY) != |
31 | article.modified | strftime(DATE_FORMAT_DAY) -%} |
32 | <span> / </span> |
33 | <time datetime="{{- article.modified | |
34 | strftime('%Y-%m-%d %H:%M') -}}"> |
35 | {{- article.modified | strftime(DATE_FORMAT_MINUTE) -}} |
36 | </time> |
37 | {%- endif -%} |
38 | </p> |
39 | {%- if article.description -%} |
40 | <p> |
41 | <i>{{- article.description | trim -}}</i> |
42 | </p> |
43 | {%- endif -%} |
44 | {%- if article.small -%} |
45 | <p> |
46 | <small>{{- article.small | trim -}}</small> |
47 | </p> |
48 | {%- endif -%} |
49 | {# <!--XXX skip links --> #} |
50 | {%- endblock -%} |
51 | {%- block maincontentintro -%} |
52 | {%- if article.image -%} |
53 | <div class="image" style=" |
54 | background-image: url('{{- article.image.filename -}}'); |
55 | {%- if article.image.position -%} |
56 | background-position: {{ |
57 | article.image.position |
58 | }}; |
59 | {%- endif -%} |
60 | {%- if article.image.height -%} |
61 | height: {{ |
62 | article.image.height |
63 | }}; |
64 | {%- else -%} |
65 | height: 4rem; |
66 | {%- endif -%} |
67 | "> |
68 | </div> |
69 | {%- endif -%} |
70 | {%- endblock -%} |
71 | {%- block maincontent -%} |
72 | {{- article.content | trim -}} |
73 | {%- endblock -%} |
74 | {%- block main -%} |
75 | <article> |
76 | {{- super() -}} |
77 | {%- if article.links or article.related_posts -%} |
78 | {#- <!-- article.related_posts implies that |
79 | at least 1 tag also appears in another article. --> -#} |
80 | <footer> |
81 | <hr class="visuallyhidden"> |
82 | {%- if article.links -%} |
83 | <ul class="biglinks"> |
84 | {%- for link in article.links -%} |
85 | <li> |
86 | <a href="{{- link.url -}}"> |
87 | <strong>{{- link.title | trim -}}</strong> |
88 | {%- if link.description -%} |
89 | <span class="visuallyhidden">: </span> |
90 | <i>{{- link.description | trim -}}</i> |
91 | {%- endif -%} |
92 | </a> |
93 | </li> |
94 | {%- endfor -%} |
95 | </ul> |
96 | {%- endif -%} |
97 | {%- if article.related_posts -%} |
98 | {#- <!-- This implies that |
99 | at least 1 of this article's tags |
100 | also appears in another article. |
101 | --> -#} |
102 | <section class="smalllinks"> |
103 | <h2>Labels:</h2> |
104 | <ul> |
105 | {%- for tag in article.tags -%} |
106 | {#- <!-- Loop through this article's tags, in order. |
107 | --> -#} |
108 | {%- for anytag, articles in tags if |
109 | anytag == tag and |
110 | articles | list | length > 1 -%} |
111 | {#- <!-- Loop through *all* tags; |
112 | find the tag we're considering. |
113 | Only display it if |
114 | it's applied to more than 1 article. |
115 | --> -#} |
116 | <li> |
117 | <a href="/entries/{{- tag.slug -}}"> |
118 | {{- tag -}} |
119 | </a> |
120 | </li> |
121 | {%- endfor -%} |
122 | {%- endfor -%} |
123 | </ul> |
124 | <hr class="visuallyhidden"> |
125 | </section> |
126 | {%- endif -%} |
127 | </footer> |
128 | {%- endif -%} |
129 | </article> |
130 | {%- endblock -%} |
131 | {%- block bottomnav -%} |
132 | {%- if article.related_posts -%} |
133 | <ul class="biglinks"> |
134 | {%- for article in article.related_posts -%} |
135 | <li> |
136 | <a href="/{{- article.url -}}"> |
137 | <strong>{{- article.title | trim -}}</strong> |
138 | <span class="visuallyhidden"> (</span> |
139 | <time datetime="{{- article.date | |
140 | strftime('%Y-%m-%d %H:%M') -}}"> |
141 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
142 | </time> |
143 | <span class="visuallyhidden">)</span> |
144 | {%- if article.description -%} |
145 | <span class="visuallyhidden">: </span> |
146 | <i> |
147 | {{- article.description | striptags -}} |
148 | </i> |
149 | {%- endif -%} |
150 | </a> |
151 | </li> |
152 | {%- endfor -%} |
153 | </ul> |
154 | <hr class="visuallyhidden"> |
155 | {%- endif -%} |
156 | <nav class="nearby"> |
157 | <ul> |
158 | {%- if article.next_article -%} |
159 | <li class="next"> |
160 | <a href="/{{- article.next_article.url -}}" rel="next"> |
161 | <span> → </span> |
162 | {{- article.next_article.title | trim -}} |
163 | </a> |
164 | </li> |
165 | {%- endif -%} |
166 | {%- if article.prev_article -%} |
167 | <li class="prev"> |
168 | <a href="/{{- article.prev_article.url -}}" rel="prev"> |
169 | <span> ← </span> |
170 | {{- article.prev_article.title | trim -}} |
171 | </a> |
172 | </li> |
173 | {%- endif -%} |
174 | <li class="up"> |
175 | <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up"> |
176 | <span> ↑ </span> |
177 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
178 | </a> |
179 | </li> |
180 | </ul> |
181 | </nav> |
182 | {{- super() -}} |
183 | {%- endblock -%} |
184 | |
185 |
Built with git-ssb-web