Files: 173a8cf5c44e8a852fa2ab25bb86b1d88de44ae6 / themes / ran / templates / article.html
4948 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 | {#- #} {# -#} |
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 | {#- #} {# -#} |
139 | <time datetime="{{- article.date | |
140 | strftime('%Y-%m-%d %H:%M') -}}"> |
141 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
142 | </time> |
143 | {%- if article.description -%} |
144 | {#- #} {# -#} |
145 | <i> |
146 | {{- article.description | striptags -}} |
147 | </i> |
148 | {%- endif -%} |
149 | </a> |
150 | </li> |
151 | {%- endfor -%} |
152 | </ul> |
153 | {%- endif -%} |
154 | <nav class="nearby"> |
155 | <ul> |
156 | {%- if article.prev_article -%} |
157 | <li> |
158 | <a href="/{{- article.prev_article.url -}}" rel="prev"> |
159 | <span> ← </span> |
160 | {{- article.prev_article.title | trim -}} |
161 | </a> |
162 | </li> |
163 | {%- endif -%} |
164 | <li> |
165 | <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up"> |
166 | <span> ↑ </span> |
167 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
168 | </a> |
169 | </li> |
170 | {%- if article.next_article -%} |
171 | <li> |
172 | <a href="/{{- article.next_article.url -}}" rel="next"> |
173 | <span> → </span> |
174 | {{- article.next_article.title | trim -}} |
175 | </a> |
176 | </li> |
177 | {%- endif -%} |
178 | </ul> |
179 | </nav> |
180 | {{- super() -}} |
181 | {%- endblock -%} |
182 | |
183 |
Built with git-ssb-web