Skip to content

Instantly share code, notes, and snippets.

@iChris
Created October 4, 2023 02:37
Show Gist options
  • Save iChris/1180744978f88bba02f39d7ef0145b74 to your computer and use it in GitHub Desktop.
Save iChris/1180744978f88bba02f39d7ef0145b74 to your computer and use it in GitHub Desktop.
WP.njk Andy Original
---
permalink: 'wp.xml'
---
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.2/"
>
<channel>
<title>YOUR NAME HERE</title>
<link>YOUR WEB ADDRESS</link>
<description>Just another WordPress site</description>
<pubDate>Wed, 15 Dec 2021 10:27:40 +0000</pubDate>
<language>en-GB</language>
<wp:wxr_version>1.2</wp:wxr_version>
<wp:base_site_url>YOUR WEB ADDRESS</wp:base_site_url>
<wp:base_blog_url>YOUR WEB ADDRESS</wp:base_blog_url>
<wp:category>
<wp:term_id>1</wp:term_id>
<wp:category_nicename><![CDATA[uncategorized]]></wp:category_nicename>
<wp:category_parent><![CDATA[]]></wp:category_parent>
<wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name>
</wp:category>
<wp:term>
<wp:term_id>1</wp:term_id>
<wp:term_taxonomy><![CDATA[category]]></wp:term_taxonomy>
<wp:term_slug><![CDATA[uncategorized]]></wp:term_slug>
<wp:term_parent><![CDATA[]]></wp:term_parent>
<wp:term_name><![CDATA[Uncategorized]]></wp:term_name>
</wp:term>
<generator>https://wordpress.org/?v=5.8.1</generator>
{% for item in collections.items %}
<item>
<title><![CDATA[{{ item.date }}]]></title>
<link>YOUR WEB ADDRESS/{{ item.fileSlug }}/</link>
<pubDate>{{ item.data.title }}</pubDate>
<dc:creator><![CDATA[test]]></dc:creator>
<description></description>
<content:encoded><![CDATA[{{ item.templateContent | safe }}]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>{{ loop.index + 5 }}</wp:post_id>
<wp:post_date><![CDATA[{{ item.data.title | w3DateFilter }}]]></wp:post_date>
<wp:comment_status><![CDATA[closed]]></wp:comment_status>
<wp:ping_status><![CDATA[closed]]></wp:ping_status>
<wp:post_name><![CDATA[{{ item.fileSlug }}d]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type><![CDATA[post]]></wp:post_type>
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
</item>
{% endfor %}
</channel>
</rss>
@iChris
Copy link
Author

iChris commented Oct 4, 2023

39: <title><![CDATA[{{ item.date }}]]></title>

Shouldn't that be something title related, not the date?

41: <pubDate>{{ item.data.title }}47:wp:post_date</wp:post_date>`

Shouldn't that be something date related, not just the title?

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