miniblog

Miniblog: A command-line static blog system in Common Lisp
Log | Files | Refs | README | LICENSE

posts.dtl (1608B)


      1 {% extends "template.dtl" %}
      2 {% block html-head %}
      3   {% super %}
      4   {% if twitter-card %}
      5     <meta name="twitter:card" content="summary">
      6     {% if twitter-card.image %}
      7       <meta name="twitter:image" content="{{ twitter-card.image }}">
      8     {% endif %}
      9     {% if posts %}
     10       {% comment %}
     11         Djula doesn't offer a clean way to just grab the CAR from posts so this
     12         is a placeholder.
     13       {% endcomment %}
     14       {% for post in posts %}
     15         {% if forloop.first %}
     16           <meta name="twitter:title" content="{{ post.title }}">
     17           <meta name="twitter:description" content="{{ post.content|markdown|strip-html|truncatechars:200 }}">
     18         {% endif %}
     19       {% endfor %}
     20     {% else %}
     21       <meta name="twitter:title" content="{{ title }}">
     22     {% endif %}
     23   {% endif %}
     24 {% endblock %}
     25 {% block main %}
     26   {% if posts %}
     27     {% for post in posts %}
     28       {% if not forloop.first %}
     29         <hr>
     30       {% endif %}
     31       {% ifchanged post.created-at-short %}
     32         <h1>{{ post.created-at-short }}</h1>
     33       {% endifchanged %}
     34       <a name="{{ post.id }}"></a>
     35       <h2>{{ post.title }}</h2>
     36       <article>{{ post.content|safe|markdown }}</article>
     37       <p role="note">
     38         <small>
     39           Posted by {{ post.created-by }} on {{ post.created-at-long }}
     40           {% ifnotequal post.created-at-long post.last-updated-at-long %}
     41             <br>
     42             Last updated by {{ post.last-updated-by }} on {{ post.last-updated-at-long }}
     43           {% endifnotequal %}
     44         </small>
     45       </p>
     46     {% endfor %}
     47   {% else %}
     48     No posts found.
     49   {% endif %}
     50 {% endblock %}