mirror of
				https://github.com/valentineus/popov.link.git
				synced 2025-11-04 14:59:45 +03:00 
			
		
		
		
	Added RSS
This commit is contained in:
		
							
								
								
									
										20
									
								
								src/pages/feed.xml.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								src/pages/feed.xml.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
import rss from "@astrojs/rss";
 | 
			
		||||
import { getCollection } from "astro:content";
 | 
			
		||||
 | 
			
		||||
export async function GET(context) {
 | 
			
		||||
	const posts = await getCollection("blog");
 | 
			
		||||
 | 
			
		||||
	return rss({
 | 
			
		||||
		customData: `<language>ru-ru</language>`,
 | 
			
		||||
		description: "Tech insights and coding best practices from an OpenSource enthusiast and ethical hacker.",
 | 
			
		||||
		items: posts.map((post) => ({
 | 
			
		||||
			customData: post.data.customData,
 | 
			
		||||
			description: post.data.description,
 | 
			
		||||
			link: `/blog/${post.slug}`,
 | 
			
		||||
			pubDate: post.data.pubDate,
 | 
			
		||||
			title: post.data.title,
 | 
			
		||||
		})),
 | 
			
		||||
		site: context.site,
 | 
			
		||||
		title: "Valentin Popov’s Technology Blog",
 | 
			
		||||
	});
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user