@@ -42,7 +42,9 @@ ${stylesheet ? `<?xml-stylesheet href="${stylesheet}" type="text/xsl"?>\n` : ""}
42
42
<id>{{ metadata.base | addPathPrefixToFullUrl }}</id>
43
43
<author>
44
44
<name>{{ metadata.author.name }}</name>
45
+ {%- if metadata.author.email %}
45
46
<email>{{ metadata.author.email }}</email>
47
+ {%- endif %}
46
48
</author>
47
49
{%- for post in collections['${ collection . name } '] | reverse | head(${ collection . limit } ) %}
48
50
{%- set absolutePostUrl %}{{ post.url | htmlBaseUrl(metadata.base) }}{% endset %}
@@ -67,8 +69,9 @@ ${stylesheet ? `<?xml-stylesheet href="${stylesheet}" type="text/xsl"?>\n` : ""}
67
69
"description": "{{ metadata.description }}",
68
70
"authors": [
69
71
{
70
- "name": "{{ metadata.author.name }}",
71
- "url": "{{ metadata.author.url }}"
72
+ "name": "{{ metadata.author.name }}"{% if metadata.author.email %},
73
+ "url": "mailto:{{ metadata.author.email }}"
74
+ {%- endif %}
72
75
}
73
76
],
74
77
"items": [
@@ -91,18 +94,19 @@ ${stylesheet ? `<?xml-stylesheet href="${stylesheet}" type="text/xsl"?>\n` : ""}
91
94
}
92
95
93
96
async function eleventyFeedPlugin ( eleventyConfig , options = { } ) {
94
- eleventyConfig . versionCheck ( ">=3.0.0-alpha.11" ) ;
97
+ eleventyConfig . versionCheck ( pkg [ "11ty" ] . compatibility ) ;
95
98
96
- // Guaranteed unique
99
+ // Guaranteed unique, first add wins
97
100
const pluginRss = require ( "../.eleventy.js" ) ;
98
101
eleventyConfig . addPlugin ( pluginRss , options . rssPluginOptions || { } ) ;
99
102
100
- // Guaranteed unique
103
+ // Guaranteed unique, first add wins
101
104
const pluginHtmlBase = await eleventyConfig . resolvePlugin ( "@11ty/eleventy/html-base-plugin" ) ;
102
105
eleventyConfig . addPlugin ( pluginHtmlBase , options . htmlBasePluginOptions || { } ) ;
103
106
104
107
let slugifyFilter = eleventyConfig . getFilter ( "slugify" ) ;
105
108
let inputPathSuffix = options ?. metadata ?. title ? `-${ slugifyFilter ( options ?. metadata ?. title ) } ` : "" ;
109
+
106
110
options = DeepCopy ( {
107
111
// rss and json also supported
108
112
type : "atom" ,
@@ -120,7 +124,7 @@ async function eleventyFeedPlugin(eleventyConfig, options = {}) {
120
124
base : "https://example.com/" ,
121
125
author : {
122
126
name : "Your Name" ,
123
- email : "me@example.com"
127
+ email : "" , // Optional
124
128
}
125
129
}
126
130
} , options ) ;
0 commit comments