Files: 2a2b9271cfb5614e3cbf6c6b3ff2f4b127e8abe9 / themes / ran / templates / article.html
4859 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 | {%- if article.links -%} |
82 | <ul class="biglinks"> |
83 | {%- for link in article.links -%} |
84 | <li> |
85 | <a href="{{- link.url -}}"> |
86 | <strong>{{- link.title | trim -}}</strong> |
87 | {%- if link.description -%} |
88 | <i>{{- link.description | trim -}}</i> |
89 | {%- endif -%} |
90 | </a> |
91 | </li> |
92 | {%- endfor -%} |
93 | </ul> |
94 | {%- endif -%} |
95 | {%- if article.related_posts -%} |
96 | {#- <!-- This implies that |
97 | at least 1 of this article's tags |
98 | also appears in another article. |
99 | --> -#} |
100 | <section class="smalllinks"> |
101 | <h2>Labels:</h2> |
102 | <ul> |
103 | {%- for tag in article.tags -%} |
104 | {#- <!-- Loop through this article's tags, in order. |
105 | --> -#} |
106 | {%- for anytag, articles in tags if |
107 | anytag == tag and |
108 | articles | list | length > 1 -%} |
109 | {#- <!-- Loop through *all* tags; |
110 | find the tag we're considering. |
111 | Only display it if |
112 | it's applied to more than 1 article. |
113 | --> -#} |
114 | <li> |
115 | <a href="/entries/{{- tag.slug -}}"> |
116 | {{- tag -}} |
117 | </a> |
118 | </li> |
119 | {%- endfor -%} |
120 | {%- endfor -%} |
121 | </ul> |
122 | </section> |
123 | {%- endif -%} |
124 | </footer> |
125 | {%- endif -%} |
126 | </article> |
127 | {%- endblock -%} |
128 | {%- block bottomnav -%} |
129 | {%- if article.related_posts -%} |
130 | <ul class="biglinks"> |
131 | {%- for article in article.related_posts -%} |
132 | <li> |
133 | <a href="/{{- article.url -}}"> |
134 | <strong>{{- article.title | trim -}}</strong> |
135 | {#- #} {# -#} |
136 | <time datetime="{{- article.date | |
137 | strftime('%Y-%m-%d %H:%M') -}}"> |
138 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
139 | </time> |
140 | {%- if article.description -%} |
141 | {#- #} {# -#} |
142 | <i> |
143 | {{- article.description | striptags -}} |
144 | </i> |
145 | {%- endif -%} |
146 | </a> |
147 | </li> |
148 | {%- endfor -%} |
149 | </ul> |
150 | {%- endif -%} |
151 | <nav class="nearby"> |
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> |
176 | </nav> |
177 | {{- super() -}} |
178 | {%- endblock -%} |
179 | |
180 |
Built with git-ssb-web