Compare commits

..

3 Commits

Author SHA1 Message Date
12ac5ac1fb Consistent use of {{SITEURL}} 2019-04-23 14:16:20 +05:30
d78493f3d0 Variable PAGE_PAGINATION 2019-04-23 14:16:01 +05:30
84934c65e2 Add article list. 2019-04-23 14:14:50 +05:30
3 changed files with 56 additions and 2 deletions

View File

@ -38,7 +38,7 @@
<meta property="twitter:image" content="{{ SITEURL }}/{{ article.twitter_image }}">
{% endif %}
{% elif article.header_cover %}
<meta name="twitter:image" content="{{ SITEURL }}{{ article.header_cover }}">
<meta name="twitter:image" content="{{ SITEURL }}/{{ article.header_cover }}">
{% elif HEADER_COVER %}
<meta name="twitter:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
{% else %}
@ -78,7 +78,7 @@
<meta property="og:image" content="{{ SITEURL }}/{{ article.og_image }}">
{% endif %}
{% elif article.header_cover %}
<meta property="og:image" content="{{ SITEURL }}{{ article.header_cover }}">
<meta property="og:image" content="{{ SITEURL }}/{{ article.header_cover }}">
{% elif HEADER_COVER %}
<meta property="og:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
{% else %}

View File

@ -0,0 +1,29 @@
<h1 class="section-heading" style="font-variant: small-caps">Recent Articles</h1>
{% for article in articles %}
{% if loop.index > PAGE_PAGINATION %}{% break %}{% endif %}
<div class="post-preview">
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
<h2 class="post-title">
{{ article.title }}
</h2>
</a>
{% if SHOW_FULL_ARTICLE %}
{{ article.content }}
{% else %}
<p class="article-summary">
{% if article.has_summary %}
{{ article.summary }}
{% elif article.summary %}
{{ article.summary|striptags|truncate(140) }}
{% endif %}
</p>
{% endif %}
<p class="post-meta">Posted by
{% for author in article.authors %}
<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
on {{ article.locale_date }}
</p>
{% include 'comments.html' %}
</div>
{% endfor %}

View File

@ -25,8 +25,33 @@
</header>
{% endblock header %}
{% block opengraph %}
{{ super() }}
{% if page.summary %}
<meta property="og:description" content="{{ page.summary|striptags|truncate(140) }}">
{% endif %}
{% if page.og_image %}
{% if page.og_image|lower|truncate(4, True, '') == "http" %}
<meta property="og:image" content="{{ page.og_image }}">
{% else %}
<meta property="og:image" content="{{ SITEURL }}/{{ page.og_image }}">
{% endif %}
{% elif page.header_cover %}
<meta property="og:image" content="{{ SITEURL }}/{{ page.header_cover }}">
{% elif HEADER_COVER %}
<meta property="og:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
{% else %}
<meta property="og:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
{% endif %}
{% endblock %}
{% block content %}
<article>
{{ page.content }}
{% if page.article_list and PAGE_PAGINATION > 0 %}
<hr />
{% include "last_articles.html" %}
{% endif %}
</article>
{% endblock content %}