Skip to content

Instantly share code, notes, and snippets.

@freakdesign
Last active October 19, 2021 21:48
Show Gist options
  • Save freakdesign/0c8986f21ca9a99a42c9 to your computer and use it in GitHub Desktop.
Save freakdesign/0c8986f21ca9a99a42c9 to your computer and use it in GitHub Desktop.
Shopify RSS atom feed

Shopify alternate template code for Mailchimp RSS feed

Update coming soon to handle the blog images...

Relates to this Creating a RSS feed for Shopify blog post.

{% layout none %}{% comment %}
/*
* Simple blog feed
*
* Copyright (c) 2015 Jason Bowman ([email protected])
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
*/
{% endcomment %}<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<id>{{ canonical_url }}.atom</id>
<link rel="alternate" type="text/html" href="{{ canonical_url }}"/>
<link rel="self" type="application/atom+xml" href="{{ canonical_url }}?view={{ template | split:'.' | last }}"/>
<title>{{ shop.name }} - {{ blog.title }}</title>
{% for article in blog.articles limit:20 %}{% if forloop.first %}
<updated>{{ article.created_at | date: "%FT%TZ" }}</updated>
<author>
<name>{{ shop.name }}</name>
</author>
{% endif %}<entry>
<id>{{ shop.url }}/{{ article.url }}</id>
<published>{{ article.created_at | date: "%FT%TZ" }}</published>
<updated>{{ article.created_at | date: "%FT%TZ" }}</updated>
<link rel="alternate" type="text/html" href="{{ shop.url }}/{{ article.url }}"/>
<title><![CDATA[{{ article.title }}]]></title>
<author>
<name>{{ article.author }}</name>
</author>
<content type="html">{% assign articleContent = article.content %}
<![CDATA[{{ articleContent | replace:'"//cdn','http://cdn' }}]]>
</content>
</entry>{% endfor %}
</feed>
@dwa012
Copy link

dwa012 commented Jun 11, 2015

I am trying to add an attribute to the entries and I am not sure how to configure shopify to use this template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment