Files: a69243673b022c68aae9ed62d69c212758bcce23 / themes / ran / templates / article.html
4737 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 | <span> |
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 | </span> |
39 | {%- if article.description -%} |
40 | {#- #} {# -#} |
41 | <i>{{- article.description | trim -}}</i> |
42 | {%- endif -%} |
43 | {%- if article.small -%} |
44 | <i>{{- article.small | trim -}}</i> |
45 | {%- endif -%} |
46 | {# <!--XXX skip links --> #} |
47 | {%- endblock -%} |
48 | {%- block maincontentintro -%} |
49 | {%- if article.image -%} |
50 | <footer class="image" style=" |
51 | background-image: url('{{- article.image.filename -}}'); |
52 | {%- if article.image.position -%} |
53 | background-position: {{ |
54 | article.image.position |
55 | }}; |
56 | {%- endif -%} |
57 | {%- if article.image.height -%} |
58 | height: {{ |
59 | article.image.height |
60 | }}; |
61 | {%- else -%} |
62 | height: 4rem; |
63 | {%- endif -%} |
64 | "> |
65 | </footer> |
66 | {%- endif -%} |
67 | {%- endblock -%} |
68 | {%- block maincontent -%} |
69 | {{- article.content | trim -}} |
70 | {%- endblock -%} |
71 | {%- block main -%} |
72 | <article> |
73 | {{- super() -}} |
74 | {%- if article.links or article.related_posts -%} |
75 | {#- <!-- article.related_posts implies that |
76 | at least 1 tag also appears in another article. --> -#} |
77 | <footer> |
78 | {%- if article.links -%} |
79 | <ul class="biglinks"> |
80 | {%- for link in article.links -%} |
81 | <li> |
82 | <a href="{{- link.url -}}"> |
83 | <h1>{{- link.title | trim -}}</h1> |
84 | {%- if link.description -%} |
85 | <i>{{- link.description | trim -}}</i> |
86 | {%- endif -%} |
87 | </a> |
88 | </li> |
89 | {%- endfor -%} |
90 | </ul> |
91 | {%- endif -%} |
92 | {%- if article.related_posts -%} |
93 | {#- <!-- This implies that |
94 | at least 1 of this article's tags |
95 | also appears in another article. |
96 | --> -#} |
97 | <section class="smalllinks"> |
98 | <h1>Labels:</h1> |
99 | <ul> |
100 | {%- for tag in article.tags -%} |
101 | {#- <!-- Loop through this article's tags, in order. |
102 | --> -#} |
103 | {%- for anytag, articles in tags if |
104 | anytag == tag and |
105 | articles | list | length > 1 -%} |
106 | {#- <!-- Loop through *all* tags; |
107 | find the tag we're considering. |
108 | Only display it if |
109 | it's applied to more than 1 article. |
110 | --> -#} |
111 | <li> |
112 | <a href="/entries/{{- tag.slug -}}"> |
113 | {{- tag -}} |
114 | </a> |
115 | </li> |
116 | {%- endfor -%} |
117 | {%- endfor -%} |
118 | </ul> |
119 | </section> |
120 | {%- endif -%} |
121 | </footer> |
122 | {%- endif -%} |
123 | </article> |
124 | {%- endblock -%} |
125 | {%- block bottomnav -%} |
126 | {%- if article.related_posts -%} |
127 | <ul class="biglinks"> |
128 | {%- for article in article.related_posts -%} |
129 | <li> |
130 | <a href="/{{- article.url -}}"> |
131 | <h1>{{- article.title | trim -}}</h1> |
132 | {#- #} {# -#} |
133 | <time datetime="{{- article.date | |
134 | strftime('%Y-%m-%d %H:%M') -}}"> |
135 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
136 | </time> |
137 | {%- if article.description -%} |
138 | {#- #} {# -#} |
139 | <i> |
140 | {{- article.description | striptags -}} |
141 | </i> |
142 | {%- endif -%} |
143 | </a> |
144 | </li> |
145 | {%- endfor -%} |
146 | </ul> |
147 | {%- endif -%} |
148 | <nav class="nearby"> |
149 | <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" rel="up"> |
150 | <span> ↑ </span> |
151 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
152 | </a> |
153 | {%- if article.next_article -%} |
154 | <a href="/{{- article.next_article.url -}}" rel="next"> |
155 | <span> → </span> |
156 | {{- article.next_article.title | trim -}} |
157 | </a> |
158 | {%- endif -%} |
159 | {%- if article.prev_article -%} |
160 | <a href="/{{- article.prev_article.url -}}" rel="prev"> |
161 | <span> ← </span> |
162 | {{- article.prev_article.title | trim -}} |
163 | </a> |
164 | {%- endif -%} |
165 | </nav> |
166 | {{- super() -}} |
167 | {%- endblock -%} |
168 | |
169 |
Built with git-ssb-web