Better blog RSS
parent
2a949cd3f2
commit
f99d0303a4
|
@ -0,0 +1,29 @@
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
{% if request.blog_user.username == 'nick' %}
|
||||||
|
<atom:link href="http://nicksergeant.com/?rss" rel="self" type="application/rss+xml" />
|
||||||
|
<description>Nick Sergeant</description>
|
||||||
|
<title>Nick Sergeant</title>
|
||||||
|
<link>http://nicksergeant.com/?rss</link>
|
||||||
|
{% elif request.blog_user.username == 'blog' %}
|
||||||
|
<atom:link href="https://blog.snipt.net/?rss" rel="self" type="application/rss+xml" />
|
||||||
|
<description>Snipt Blog</description>
|
||||||
|
<title>Snipt Blog</title>
|
||||||
|
<link>https://blog.snipt.net/?rss</link>
|
||||||
|
{% else %}
|
||||||
|
<atom:link href="https://{{ request.blog_user.username }}.snipt.net/?rss" rel="self" type="application/rss+xml" />
|
||||||
|
<description>{% if request.blog_user.username == 'nick' %}Nick Sergeant{% else %}{{ request.blog_user.username }}{% endif %}</description>
|
||||||
|
<title>{% if request.blog_user.username == 'nick' %}Nick Sergeant{% else %}{{ request.blog_user.username }}{% endif %}</title>
|
||||||
|
<link>https://{{ request.blog_user.username }}.snipt.net/?rss</link>
|
||||||
|
{% endif %}
|
||||||
|
{% for snipt in snipts %}
|
||||||
|
<item>
|
||||||
|
<title>{{ snipt.title }}</title>
|
||||||
|
<link>{{ snipt.get_full_absolute_url }}</link>
|
||||||
|
<description><![CDATA[{{ snipt.stylized|safe }}]]></description>
|
||||||
|
<pubDate>{{ snipt.created|date:"r" }}</pubDate>
|
||||||
|
<guid isPermaLink="false">snipt-net-{{ snipt.id }}</guid>
|
||||||
|
</item>
|
||||||
|
{% endfor %}
|
||||||
|
</channel>
|
||||||
|
</rss>
|
|
@ -58,7 +58,7 @@ def blog_post(request, username_or_custom_slug):
|
||||||
|
|
||||||
def rss(request, context):
|
def rss(request, context):
|
||||||
return render_to_response(
|
return render_to_response(
|
||||||
'rss.xml',
|
'blogs/themes/default/rss.xml',
|
||||||
context,
|
context,
|
||||||
context_instance=RequestContext(request),
|
context_instance=RequestContext(request),
|
||||||
mimetype="application/rss+xml"
|
mimetype="application/rss+xml"
|
||||||
|
|
|
@ -1,39 +1,17 @@
|
||||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
<channel>
|
<channel>
|
||||||
{% if request.blog_user %}
|
<atom:link href="https://snipt.net{{ request.get_full_path }}" rel="self" type="application/rss+xml" />
|
||||||
{% if request.blog_user.username == 'nick' %}
|
<description>{% if public and not public_user %}Public snipts{% else %}Snipts by {{ user.username }}{% endif %}{% if tag %} tagged with "{{ tag }}"{% endif %}</description>
|
||||||
<atom:link href="http://nicksergeant.com/?rss" rel="self" type="application/rss+xml" />
|
<title>/ {% if public and not public_user %}public{% else %}{{ user.username }}{% endif %}{% if tag %} / {{ tag }}{% endif %} - Snipt</title>
|
||||||
<description>Nick Sergeant</description>
|
<link>https://snipt.net{{ request.path }}</link>
|
||||||
<title>Nick Sergeant</title>
|
{% for snipt in snipts %}
|
||||||
<link>http://nicksergeant.com/?rss</link>
|
|
||||||
{% elif request.blog_user.username == 'blog' %}
|
|
||||||
<atom:link href="https://blog.snipt.net/?rss" rel="self" type="application/rss+xml" />
|
|
||||||
<description>Snipt Blog</description>
|
|
||||||
<title>Snipt Blog</title>
|
|
||||||
<link>https://blog.snipt.net/?rss</link>
|
|
||||||
{% else %}
|
|
||||||
<atom:link href="https://{{ request.blog_user.username }}.snipt.net/?rss" rel="self" type="application/rss+xml" />
|
|
||||||
<description>{% if request.blog_user.username == 'nick' %}Nick Sergeant{% else %}{{ request.blog_user.username }}{% endif %}</description>
|
|
||||||
<title>{% if request.blog_user.username == 'nick' %}Nick Sergeant{% else %}{{ request.blog_user.username }}{% endif %}</title>
|
|
||||||
<link>https://{{ request.blog_user.username }}.snipt.net/?rss</link>
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
<atom:link href="https://snipt.net{{ request.get_full_path }}" rel="self" type="application/rss+xml" />
|
|
||||||
<description>{% if public and not public_user %}Public snipts{% else %}Snipts by {{ user.username }}{% endif %}{% if tag %} tagged with "{{ tag }}"{% endif %}</description>
|
|
||||||
<title>/ {% if public and not public_user %}public{% else %}{{ user.username }}{% endif %}{% if tag %} / {{ tag }}{% endif %} - Snipt</title>
|
|
||||||
<link>https://snipt.net{{ request.path }}</link>
|
|
||||||
{% endif %}
|
|
||||||
{% for snipt in snipts %}
|
|
||||||
<item>
|
<item>
|
||||||
<title>{{ snipt.title }}</title>
|
<title>{{ snipt.title }}</title>
|
||||||
<link>{{ snipt.get_full_absolute_url }}</link>
|
<link>{{ snipt.get_full_absolute_url }}</link>
|
||||||
{% if snipt.user.username == 'blog' %}
|
<description><![CDATA[{{ snipt.code }}]]></description>
|
||||||
<description><![CDATA[{{ snipt.stylized|safe }}]]></description>
|
|
||||||
{% else %}
|
|
||||||
<description><![CDATA[{{ snipt.code }}]]></description>
|
|
||||||
{% endif %}
|
|
||||||
<pubDate>{{ snipt.created|date:"r" }}</pubDate>
|
<pubDate>{{ snipt.created|date:"r" }}</pubDate>
|
||||||
<guid isPermaLink="false">snipt-net-{{ snipt.id }}</guid>
|
<guid isPermaLink="false">snipt-net-{{ snipt.id }}</guid>
|
||||||
</item>{% endfor %}
|
</item>
|
||||||
|
{% endfor %}
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
|
|
Loading…
Reference in New Issue