Add some nice social sharing previews
[books.alexwlchan.net] / templates / review.html
1 {% extends "base.html" %}
2
3 {% block head_content %}
4 <meta name="twitter:card" content="summary">
5 <meta name="twitter:site" content="@alexwlchan"/>
6 <meta name="twitter:title" content="alexwlchan's review of {{ review_entry.book.title }}"/>
7 <meta name="twitter:image" content="https://books.alexwlchan.net/squares/{{ review_entry.book.cover_image }}"/>
8
9 <meta property="og:type" content="article" />
10 <meta property="og:url" content="https://books.alexwlchan.net/{{ review_entry.out_path() }}">
11 <meta property="og:title" content="alexwlchan's review of {{ review_entry.book.title }}">
12 <meta property="og:image" content="https://books.alexwlchan.net/squares/{{ review_entry.book.cover_image }}"/>
13 {% endblock %}
14
15 {% block content %}
16   {% if review_entry.book.cover_image %}
17     <div class="book-cover">
18       {% set book = review_entry.book %}
19       {% include "_book_cover.html" %}
20     </div>
21   {% endif %}
22
23   <h1>My review of <span class="book-title">{{ review_entry.book.title | smartypants | safe }}</span></h1>
24
25   <table class="book_metadata">
26     <tr>
27       <td>author{% if "and" in review_entry.book.author or ", " in review_entry.book.author or " & " in review_entry.book.author %}s{% endif %}:</td>
28       <th>{{ review_entry.book.author }}
29         {%- if review_entry.book.publication_year %}
30           ({{ review_entry.book.publication_year}})
31         {%- endif -%}
32       </th>
33     </tr>
34     {% if review_entry.review.date_read %}
35     <tr>
36       <td>date read:</td>
37       <th>{{ review_entry.review.date_read | render_date }}</th>
38     </tr>
39     {% endif %}
40     {% if review_entry.review.rating %}
41     <tr>
42       <td>rating:</td>
43       <th>
44         {% for _ in range(review_entry.review.rating) %}
45         ★
46         {% endfor %}
47         {% for _ in range(5 - review_entry.review.rating) %}
48         ☆
49         {% endfor %}
50         {% if review_entry.review.did_not_finish %}
51         (did not finish)
52         {% endif %}
53       </th>
54     </tr>
55     {% endif %}
56   </table>
57
58   {{ review_entry.review.text | render_markdown | safe }}
59
60   <p>(see <a href="/reviews">all reviews</a>)</p>
61 {% endblock %}