miniblog

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

posts.dtl (1592B)


      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       <meta name="twitter:title" content="{{ posts.0.title }}">
     11       <meta name="twitter:description" content="{{ posts.0.rendered-content|strip-html|truncatechars:200 }}">
     12     {% else %}
     13       <meta name="twitter:title" content="{{ title }}">
     14     {% endif %}
     15   {% endif %}
     16 {% endblock %}
     17 {% block main %}
     18   {% if posts %}
     19     {% for post in posts %}
     20       {% if not forloop.first %}
     21         <hr>
     22       {% endif %}
     23       {% ifchanged post.created-at-short %}
     24         <h1>{{ post.created-at-short }}</h1>
     25       {% endifchanged %}
     26       <a name="{{ post.id }}"></a>
     27       {% if collapse-posts-p %}
     28         <h2><a href="{{ post.link }}">{{ post.title }}</a></h2>
     29         <article>
     30           {{ post.rendered-content|safe|read-more:post.link }}
     31         </article>
     32       {% else %}
     33         <h2>{{ post.title }}</h2>
     34         <article>{{ post.rendered-content|safe }}</article>
     35       {% endif %}
     36       <p role="note">
     37         <small>
     38           Posted by {{ post.created-by }} on {{ post.created-at-long }}
     39           {% ifnotequal post.created-at-long post.last-updated-at-long %}
     40             <br>
     41             Last updated by {{ post.last-updated-by }} on {{ post.last-updated-at-long }}
     42           {% endifnotequal %}
     43         </small>
     44       </p>
     45     {% endfor %}
     46   {% else %}
     47     No posts found.
     48   {% endif %}
     49 {% endblock %}