-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates samples to use alpha.13. Require alpha.13+ compatibility. Aut…
…omatically add base plugin (if not yet added)
- Loading branch information
Showing
10 changed files
with
149 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
---json | ||
{ | ||
"permalink": "atom.xml", | ||
"eleventyExcludeFromCollections": true, | ||
"metadata": { | ||
"title": "My Blog about Boats", | ||
"description": "I am writing about my experiences as a naval navel-gazer.", | ||
"language": "en", | ||
"base": "https://example.com/", | ||
"author": { | ||
"name": "Boaty McBoatFace" | ||
} | ||
} | ||
} | ||
--- | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ metadata.language or page.lang }}"> | ||
<title>{{ metadata.title }}</title> | ||
<subtitle>{{ metadata.description }}</subtitle> | ||
<link href="{{ permalink | htmlBaseUrl(metadata.base) }}" rel="self" /> | ||
<link href="{{ metadata.base | addPathPrefixToFullUrl }}" /> | ||
<updated>{{ collections.posts | getNewestCollectionItemDate | dateToRfc3339 }}</updated> | ||
<id>{{ metadata.base | addPathPrefixToFullUrl }}</id> | ||
<author> | ||
<name>{{ metadata.author.name }}</name> | ||
</author> | ||
{%- for post in collections.posts | reverse %} | ||
{%- set absolutePostUrl %}{{ post.url | htmlBaseUrl(metadata.base) }}{% endset %} | ||
<entry> | ||
<title>{{ post.data.title }}</title> | ||
<link href="{{ absolutePostUrl }}" /> | ||
<updated>{{ post.date | dateToRfc3339 }}</updated> | ||
<id>{{ absolutePostUrl }}</id> | ||
<content type="html">{{ post.content | renderTransforms(post.data.page, metadata.base) }}</content> | ||
</entry> | ||
{%- endfor %} | ||
</feed> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
const rssPlugin = require("../") | ||
|
||
module.exports = function(eleventyConfig) { | ||
// eleventyConfig.ignores.add("json.njk"); | ||
// eleventyConfig.ignores.add("atom.njk"); | ||
// eleventyConfig.ignores.add("rss.njk"); | ||
|
||
eleventyConfig.addPlugin(rssPlugin, { | ||
posthtmlRenderOptions: {} | ||
}); | ||
|
||
eleventyConfig.addJavaScriptFunction("absoluteUrl", rssPlugin.absoluteUrl); | ||
eleventyConfig.addJavaScriptFunction("htmlToAbsoluteUrls", rssPlugin.convertHtmlToAbsoluteUrls); | ||
eleventyConfig.addJavaScriptFunction("dateToRfc3339", rssPlugin.dateToRfc3339); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
---json | ||
{ | ||
"permalink": "feed.json", | ||
"eleventyExcludeFromCollections": true, | ||
"metadata": { | ||
"title": "My Blog about Boats", | ||
"description": "I am writing about my experiences as a naval navel-gazer.", | ||
"language": "en", | ||
"base": "https://example.com/", | ||
"author": { | ||
"name": "Boaty McBoatFace" | ||
} | ||
} | ||
} | ||
--- | ||
{ | ||
"version": "https://jsonfeed.org/version/1.1", | ||
"title": "{{ metadata.title }}", | ||
"language": "{{ metadata.language or page.lang }}", | ||
"home_page_url": "{{ metadata.base | addPathPrefixToFullUrl }}", | ||
"feed_url": "{{ permalink | htmlBaseUrl(metadata.base) }}", | ||
"description": "{{ metadata.description }}", | ||
"authors": [ | ||
{ | ||
"name": "{{ metadata.author.name }}" | ||
} | ||
], | ||
"items": [ | ||
{%- for post in collections.posts | reverse %} | ||
{%- set absolutePostUrl %}{{ post.url | htmlBaseUrl(metadata.base) }}{% endset %} | ||
{ | ||
"id": "{{ absolutePostUrl }}", | ||
"url": "{{ absolutePostUrl }}", | ||
"title": "{{ post.data.title }}", | ||
"content_html": {% if post.content %}{{ post.content | renderTransforms(post.data.page, metadata.base) | dump | safe }}{% else %}""{% endif %}, | ||
"date_published": "{{ post.date | dateToRfc3339 }}" | ||
} | ||
{% if not loop.last %},{% endif %} | ||
{%- endfor %} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "sample", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "config-sample.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@11ty/eleventy": "3.0.0-alpha.13" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
---json | ||
{ | ||
"permalink": "rss.xml", | ||
"eleventyExcludeFromCollections": true, | ||
"metadata": { | ||
"title": "My Blog about Boats", | ||
"description": "I am writing about my experiences as a naval navel-gazer.", | ||
"language": "en", | ||
"base": "https://example.com/", | ||
"author": { | ||
"name": "Boaty McBoatFace" | ||
} | ||
} | ||
} | ||
--- | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="{{ metadata.base | addPathPrefixToFullUrl }}" xmlns:atom="http://www.w3.org/2005/Atom"> | ||
<channel> | ||
<title>{{ metadata.title }}</title> | ||
<link>{{ metadata.base | addPathPrefixToFullUrl }}</link> | ||
<atom:link href="{{ permalink | htmlBaseUrl(metadata.base) }}" rel="self" type="application/rss+xml" /> | ||
<description>{{ metadata.description }}</description> | ||
<language>{{ metadata.language or page.lang }}</language> | ||
{%- for post in collections.posts | reverse %} | ||
{%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.base) %} | ||
<item> | ||
<title>{{ post.data.title }}</title> | ||
<link>{{ absolutePostUrl }}</link> | ||
<description>{{ post.content | renderTransforms(post.data.page, metadata.base) }}</description> | ||
<pubDate>{{ post.date | dateToRfc822 }}</pubDate> | ||
<dc:creator>{{ metadata.author.name }}</dc:creator> | ||
<guid>{{ absolutePostUrl }}</guid> | ||
</item> | ||
{%- endfor %} | ||
</channel> | ||
</rss> |