Skip to content

Commit 0fa83db

Browse files
committed
fix errors in feed
1 parent 3046a81 commit 0fa83db

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.eleventy.js

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = (eleventyConfig) => {
2020
eleventyConfig.addFilter("iso8601", rss.dateToRfc3339)
2121
eleventyConfig.addFilter("date_to_rfc3339", rss.dateToRfc3339)
2222
eleventyConfig.addFilter("date_to_rfc822", rss.dateToRfc822)
23+
eleventyConfig.addFilter("html_to_absolute_urls", rss.convertHtmlToAbsoluteUrls)
2324

2425
eleventyConfig.setLibrary(
2526
"md",

feed.xml renamed to feed.xml.liquid

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ eleventyExcludeFromCollections: true
66
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="https://webcomponents.guide/" xmlns:atom="http://www.w3.org/2005/Atom">
77
<channel>
88
<title>Web Components Guide</title>
9-
<link>https://webcomponents.guide/</link>
10-
<atom:link href="{{ permalink | absoluteUrl(metadata.url) }}" rel="self" type="application/rss+xml" />
9+
<link>{{ baseurl }}</link>
10+
<atom:link href="{{ baseurl }}/{{ page.url }}" rel="self" type="application/rss+xml" />
1111
<language>en</language>
1212
{%- for post in collections.blog | reverse %}
13-
{%- set absolutePostUrl = post.url | absoluteUrl(metadata.url) %}
13+
{%- capture absolutePostUrl %}{{ baseurl }}{{ post.url }}{% endcapture %}
1414
<item>
1515
<title>{{ post.data.title }}</title>
1616
<link>{{ absolutePostUrl }}</link>
17-
<description>{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description>
18-
<pubDate>{{ post.date | dateToRfc822 }}</pubDate>
17+
<description>{{ post.templateContent | html_to_absolute_urls: absolutePostUrl }}</description>
18+
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
1919
{%- for author in post.authors %}
2020
<dc:creator>{{ author }}</dc:creator>
2121
{%- endfor %}
2222
<guid>{{ absolutePostUrl }}</guid>
2323
</item>
2424
{%- endfor %}
2525
</channel>
26-
</rss>
26+
</rss>

0 commit comments

Comments
 (0)