@@ -0,0 +1,5 @@ | |||||
=== | |||||
title: BASIC blog full text feed | |||||
extends: atom.j2 | |||||
listable: false | |||||
=== |
@@ -0,0 +1,6 @@ | |||||
=== | |||||
title: BASIC blog excerpts feed | |||||
extends: atom.j2 | |||||
excerpts_only: true | |||||
listable: false | |||||
=== |
@@ -9,12 +9,12 @@ description: Home page for the BASIC hyde template | |||||
<section class="blog_excerpt"> | <section class="blog_excerpt"> | ||||
{% set latest = site.content.walk_resources_sorted_by_time()|first %} | {% set latest = site.content.walk_resources_sorted_by_time()|first %} | ||||
--- if latest: | |||||
{% if latest -%} | |||||
{{ render_excerpt(latest, 'post') }} | {{ render_excerpt(latest, 'post') }} | ||||
<a class="button white medium" | <a class="button white medium" | ||||
href="{{ content_url(latest.url) }}">Read more…</a> | href="{{ content_url(latest.url) }}">Read more…</a> | ||||
--- endif | |||||
{%- endif %} | |||||
</section> | </section> |
@@ -0,0 +1,40 @@ | |||||
{% from "macros.j2" import render_excerpt, render_post with context %} | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<feed xmlns="http://www.w3.org/2005/Atom"> | |||||
<title> | |||||
{% block title %}{{ resource.meta.title|default(feed_title) }}{% endblock %} | |||||
</title> | |||||
{% block self_url %} | |||||
<link href="{{ resource.url }}" rel="self" /> | |||||
{% endblock %} | |||||
{% block site_url %} | |||||
<link href="{{ content_url('') }}"/> | |||||
{% endblock %} | |||||
{% block feed_extra %} | |||||
{% endblock %} | |||||
<updated>{{ now|xmldatetime }}</updated> | |||||
<id>{{ content_url(resource.url) }}/</id> | |||||
{% for res in resource.node.walk_resources_sorted_by_time() %} | |||||
<entry> | |||||
<title type="html">{{ res.meta.title }}</title> | |||||
<author><name>{{ res.meta.author }}</name></author> | |||||
<link href="{{ content_url(res.url) }}"/> | |||||
<updated>{{ res.meta.created|xmldatetime }}</updated> | |||||
<published>{{ res.meta.created|xmldatetime }}</published> | |||||
<id>{{ content_url(res.url) }}</id> | |||||
<content type="html"> | |||||
{% if resource.meta.excerpts_only -%} | |||||
{{ render_excerpt(res) }} | |||||
{%- else %} | |||||
{{ render_post(res) }} | |||||
{%- endif %} | |||||
{{ res.text }} | |||||
</content> | |||||
</entry> | |||||
{% endfor %} | |||||
</feed> |
@@ -56,9 +56,9 @@ | |||||
</ul> | </ul> | ||||
{% endif %} | {% endif %} | ||||
{% filter markdown|typogrify -%} | {% filter markdown|typogrify -%} | ||||
{% mark post -%} | |||||
{% block post -%}{%- endblock %} | {% block post -%}{%- endblock %} | ||||
{%- endmark %} | |||||
{%- endfilter %} | {%- endfilter %} | ||||
</article> | </article> | ||||
@@ -1,3 +1,15 @@ | |||||
{% macro render_post(res) %} | |||||
{% refer to res.url as article %} | |||||
<article> | |||||
<h3><a href="{{ content_url(res.url) }}">{{ res.meta.title }}</a></h3> | |||||
<time datetime="{{ res.meta.created.strftime('%Y-%m-%d') }}"> | |||||
Posted: {{ res.meta.created.strftime('%a, %d %b %Y') }} | |||||
</time> | |||||
{{ article.post|markdown|typogrify }} | |||||
</article> | |||||
{% endmacro %} | |||||
{% macro render_excerpt(res, class=None) %} | {% macro render_excerpt(res, class=None) %} | ||||
{% refer to res.url as post %} | {% refer to res.url as post %} | ||||
<article {{'class='~class if class }}> | <article {{'class='~class if class }}> | ||||
@@ -40,6 +40,7 @@ context: | |||||
meta: | meta: | ||||
nodemeta: meta.yaml | nodemeta: meta.yaml | ||||
created: !!timestamp 2010-01-01 00:00:00 | created: !!timestamp 2010-01-01 00:00:00 | ||||
author: Lakshmi Vyasarajan | |||||
sorter: | sorter: | ||||
time: | time: | ||||
attr: | attr: | ||||