Files: 7d3903bd2b46896a43efd393948a8116e2edcca7 / themes / ran / templates / article.html
4761 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 | <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up"> |
153 | <span> ↑ </span> |
154 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
155 | </a> |
156 | {%- if article.next_article -%} |
157 | <a href="/{{- article.next_article.url -}}" rel="next"> |
158 | <span> → </span> |
159 | {{- article.next_article.title | trim -}} |
160 | </a> |
161 | {%- endif -%} |
162 | {%- if article.prev_article -%} |
163 | <a href="/{{- article.prev_article.url -}}" rel="prev"> |
164 | <span> ← </span> |
165 | {{- article.prev_article.title | trim -}} |
166 | </a> |
167 | {%- endif -%} |
168 | </nav> |
169 | {{- super() -}} |
170 | {%- endblock -%} |
171 | |
172 |
Built with git-ssb-web