~andrewzah/personal-site

personal-site/templates/post.html -rw-r--r-- 4.4 KiB View raw
dd273feeAndrew Zah begin new watch post 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{% extends "base.html" %}

{% import "macros.html" as macros %}
{% block page %}{{ page }}{% endblock page %}
{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
{% block ogtitle %}{{ page.title }} | {{ config.title }}{% endblock ogtitle %}
{% block twittertitle %}{{ page.title }} | {{ config.title }}{% endblock twittertitle %}
{% block summary %}{{ page.extra.summary | safe | striptags }}{% endblock summary %}
{% block ogsummary %}{{ page.extra.summary | safe | striptags }}{% endblock ogsummary %}
{% block keywords %}{{ page.extra.keywords }}{% endblock keywords %}
{% block permalink %}{{ page.permalink }}{% endblock permalink %}

{% block head %}
  {% if page.extra.mathjax %}
    <script async src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML'></script>
  {% endif %}
{% endblock head %}

{% block main %}
  <div itemtype="http://schema.org/Article" class="container post">
    <h1 class="page-title" itemprop="name">{{ page.title }}</h1>
    <div class="page-meta-data">
      <time itemprop="datePublished" content="{{ page.date | date(format="%Y-%m-%d")}}" datetime="{{ page.date }}" class="page-date">
          {{ page.date | date(format="%b %d, %Y") }}
          {% if page.extra.updated %} <time itemprop="dateModified" content={{ page.extra.updated }}>(updated on {{ page.extra.updated }})</time> {% endif %}
      </time>
      <span id="word-count">{{ page.word_count }} words
      </span>
    </div>
    <hr>
    <aside id="toc">
        <h2>Table of Contents</h2>
        <ol>
            {% for h2 in toc %}<li>
                <a href="#{{h2.title | safe | slugify | replace(from="amp-", to="")}}">{{ h2.title | safe }}</a>
                {% if h2.children %}<ol>
                    {% for h3 in h2.children %}<li>
                        <a href="#{{h3.title | safe | slugify | replace(from="amp-", to="")}}">{{ h3.title | safe }}</a>
                    </li>{% endfor %}
                </ol>{% endif %}
            </li>{% endfor %}
        </ol>
    </aside>
    <article itemprop="articleBody">
      {{ page.content | safe }}
      <div id="email-me">
        Have any observations, criticisms, or corrections? Feel free to <a href="mailto:blog@andrewzah.com">email me</a>. Have a nice day!
      </div>
      {% if page.extra.resources %}
        {{ macros::render_resources(resources=page.extra.resources) }}
      {% endif %}
      {% if page.extra.footnotes %}
        {{ macros::render_footnotes(footnotes=page.extra.footnotes) }}
      {% endif %}
      {% if page.extra.references %}
        {{ macros::render_references(references=page.extra.references) }}
      {% endif %}
    </article>
  </div>
{% endblock main %}

{% block after_main %}
  <div id="after-main" class="container">
    <div id="random-quote">
      <h2> Random quote </h2>
      <blockquote id="random-quote-quote"></blockquote>
      <p id="random-quote-citation">
        <span id="random-quote-author"></span>
        <span id="random-quote-source"></span>
      </p>
    </div>
    <hr>

    <div class="container after-post">
        {% if page.earlier %}
          <div id="previous_post">
            Previous: <i>
              <a class="prev" href="/posts/{{ page.earlier.slug | safe }}">{{ page.earlier.title }}</a>
            </i>
          </div>
        {% endif %}

        {% if page.later %}
          <div id="next_post">
            Next: <i>
              <a class="next" href="/posts/{{ page.later.slug | safe }}">{{ page.later.title }}</a>
            </i>
          </div>
        {% endif %}

        {% if page.taxonomies %}
          {{ macros::render_taxonomies(taxonomies=page.taxonomies) }}
        {% endif %}
    </div>

    <hr>

    <div>
      <form id="mailing-list"
        action="https://tinyletter.com/andrewzah"
        method="post" target="popupwindow"
        onsubmit="window.open('https://tinyletter.com/andrewzah', 'popupwindow', 'scrollbars=yes,width=800');return true">
        <label for="tlemail">
          Enjoy posts like this? Sign up for the mailing list!
        </label>
        <div>
          <input type="text" class="form-label" name="email" id="tlemail" />
          <input type="hidden" value="1" name="embed"/>
          <input type="submit" class="button button-primary" style="" value="Subscribe" />
        </div>
        Note: I hate spam mail as much as you do.
      </form>
    </div>
    <hr>
    </div>

    {% include "_footer.html" %}
    {% endblock after_main %}