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):
|
||||
return render_to_response(
|
||||
'rss.xml',
|
||||
'blogs/themes/default/rss.xml',
|
||||
context,
|
||||
context_instance=RequestContext(request),
|
||||
mimetype="application/rss+xml"
|
||||
|
|
|
@ -1,39 +1,17 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
{% if request.blog_user %}
|
||||
{% 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 %}
|
||||
{% 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 %}
|
||||
<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>
|
||||
{% for snipt in snipts %}
|
||||
<item>
|
||||
<title>{{ snipt.title }}</title>
|
||||
<link>{{ snipt.get_full_absolute_url }}</link>
|
||||
{% if snipt.user.username == 'blog' %}
|
||||
<description><![CDATA[{{ snipt.stylized|safe }}]]></description>
|
||||
{% else %}
|
||||
<description><![CDATA[{{ snipt.code }}]]></description>
|
||||
{% endif %}
|
||||
<description><![CDATA[{{ snipt.code }}]]></description>
|
||||
<pubDate>{{ snipt.created|date:"r" }}</pubDate>
|
||||
<guid isPermaLink="false">snipt-net-{{ snipt.id }}</guid>
|
||||
</item>{% endfor %}
|
||||
</item>
|
||||
{% endfor %}
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
Loading…
Reference in New Issue