Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 181 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.1.18",
"astro": "^5.16.6",
"markdown-it": "^14.1.0",
"mermaid": "^11.12.2",
"sanitize-html": "^2.17.0",
"sharp": "^0.34.5",
"tailwindcss": "^4.1.18"
},
"devDependencies": {
"@types/markdown-it": "^14.1.2",
"@types/sanitize-html": "^2.16.0"
}
}
7 changes: 7 additions & 0 deletions src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import type { APIContext } from 'astro';
import sanitizeHtml from 'sanitize-html';
import MarkdownIt from 'markdown-it';

const parser = new MarkdownIt();

// Get the date portion in Eastern time and return a Date at noon UTC
// This ensures the pubDate displays the correct calendar date regardless of timezone
Expand Down Expand Up @@ -40,6 +44,9 @@ export async function GET(context: APIContext) {
description: post.data.description || '',
link: `/${slug}/`,
categories: post.data.categories,
content: sanitizeHtml(parser.render(post.body ?? ''), {
allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img']),
}),
};

if (post.data.image) {
Expand Down