Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple jekyll template to generate WordPress eXtended RSS (WRX) feeds suitable for importing into a WordPress site
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
<!-- 4. Activate & Run Importer. -->
<!-- 5. Upload this file using the form provided on that page. -->
<!-- 6. You will first be asked to map the authors in this export file to users -->
<!-- on the site. For each author, you may choose to map to an -->
<!-- existing user on the site or to create a new user. -->
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!-- contained in this file into your site. -->
<!-- generator="WordPress/4.8.1" created="2017-08-21 00:17" -->
<rss version="2.0"
<title>{{ site.title }}</title>
<link>{{ site.baseurl }}</link>
<description>{{ site.description }}</description>
<pubDate>Mon, 21 Aug 2017 00:17:37 +0000</pubDate>
<wp:base_site_url>{{ site.baseurl }}</wp:base_site_url>
<wp:base_blog_url>{{ site.baseurl }}</wp:base_blog_url>
<wp:author><wp:author_id>1</wp:author_id><wp:author_login><![CDATA[Greg Boone]]></wp:author_login><wp:author_email><![CDATA[]]></wp:author_email><wp:author_display_name><![CDATA[Greg Boone]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
{% for page in site.pages %}
<title>{{ page.title }}</title>
<link>{{ site.baseurl }}{{ page.permalink }}</link>
<pubDate>Tue, 20 Oct 2009 00:00:00 +0000</pubDate>
<dc:creator><![CDATA[Greg Boone]]></dc:creator>
<guid isPermaLink="false">{{ site.baseurl }}/?page_id={{ forloop.index }}</guid>
<content:encoded><![CDATA[{{ page.content | markdownify }}]]></content:encoded>
<wp:post_id>{{ forloop.index }}</wp:post_id>
<wp:post_name><![CDATA[ ]]></wp:post_name>
{% endfor %}{% assign pagect = site.pages | size %}
{% for post in site.posts %}
<title>{{ post.title | xml_escape }}</title>
<link>{{ site.baseurl }}{{ post.permalink }}</link>
<pubDate>{{ | date_to_rfc822 }}</pubDate>
<dc:creator><![CDATA[Greg Boone]]></dc:creator>
<guid isPermaLink="false">{{ site.baseurl }}/?p={{ forloop.index | plus: pagect}}</guid>
<content:encoded><![CDATA[ {{ post.content | markdownify }}]]></content:encoded>
<wp:post_id>{{ forloop.index | plus: pagect }}</wp:post_id>
<wp:post_date><![CDATA[{{ | date: "%Y-%m-%d %T" }}]]></wp:post_date>
<wp:post_date_gmt><![CDATA[{{ |date: "%Y-%m-%d %T" }}]]></wp:post_date_gmt>
<wp:post_name><![CDATA[{{ }}]]></wp:post_name>
<category domain="category" nicename="blog"><![CDATA[Blog]]></category>
{% for tag in post.tags %}
<category domain="post_tag" nicename="{{ tag }}"><![CDATA[{{ tag }}]]></category>
{% endfor %}{% assign postmeta = post | wpmeta %}
{% for value in postmeta %}
{% endfor %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment