Compare commits

..

3 Commits

Author SHA1 Message Date
Helen Chong 974a3dea62 Remove "false" from changelog feed item link and id 2024-10-04 21:09:03 +08:00
Helen Chong 60a2b77592 Add safe filter to title 2024-10-04 19:40:05 +08:00
Helen Chong 165f20042f Upgrade @types/bun to 1.1.10 2024-10-04 19:38:00 +08:00
3 changed files with 8 additions and 6 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -12,7 +12,7 @@
}, },
"type": "module", "type": "module",
"devDependencies": { "devDependencies": {
"@types/bun": "^1.1.9" "@types/bun": "^1.1.10"
}, },
"dependencies": { "dependencies": {
"@11ty/eleventy": "^3.0.0", "@11ty/eleventy": "^3.0.0",

View File

@ -3,6 +3,8 @@
eleventyExcludeFromCollections: true eleventyExcludeFromCollections: true
eleventyComputed: eleventyComputed:
permalink: "{{ sitemeta.feedPath }}" permalink: "{{ sitemeta.feedPath }}"
feedMeta:
baseUrl: "{{ sitemeta.siteUrl }}/"
--- ---
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
@ -11,18 +13,18 @@ eleventyComputed:
<link href="{{ sitemeta.feedUrl }}" rel="self"/> <link href="{{ sitemeta.feedUrl }}" rel="self"/>
<link href="{{ sitemeta.siteUrl }}"/> <link href="{{ sitemeta.siteUrl }}"/>
<updated>{{ collections.feedItems | getNewestCollectionItemDate | dateToRfc3339 }}</updated> <updated>{{ collections.feedItems | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
<id>{{ sitemeta.siteUrl }}/</id> <id>{{ feedMeta.baseUrl }}</id>
<author> <author>
<name>{{ sitemeta.siteAuthor.name }}</name> <name>{{ sitemeta.siteAuthor.name }}</name>
<email>{{ sitemeta.siteAuthor.email }}</email> <email>{{ sitemeta.siteAuthor.email }}</email>
</author> </author>
{%- for item in collections["feed items"] | reverse | itemLimit(15) %} {%- for item in collections["feed items"] | reverse | itemLimit(15) %}
{% set absolutePostUrl %}{{ item.url | absoluteUrl(sitemeta.siteUrl) }}{% endset %} {% set absolutePostUrl %}{{ item.url | absoluteUrl(feedMeta.baseUrl) }}{% endset %}
<entry> <entry>
<title>{{ item.data.title }}</title> <title>{{ item.data.title | safe }}</title>
<link href="{{ absolutePostUrl }}"/> <link href="{{ feedMeta.baseUrl if absolutePostUrl.includes("false") else absolutePostUrl }}"/>
<updated>{{ item.date | dateToRfc3339 }}</updated> <updated>{{ item.date | dateToRfc3339 }}</updated>
<id>{{ absolutePostUrl }}</id> <id>{{ feedMeta.baseUrl if absolutePostUrl.includes("false") else absolutePostUrl }}</id>
<content type="html">{{ item.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content> <content type="html">{{ item.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
</entry> </entry>
{%- endfor %} {%- endfor %}