@@ -3,30 +3,32 @@ import { getAllPosts } from './blog'
33
44export async function generateRssFeed ( type : 'rss' | 'atom' | 'json' = 'rss' ) {
55 const allPosts = ( await getAllPosts ( ) ) ?? [ ]
6- const site_url = process . env . VERCEL ? 'https://trialanderror.org' : 'http://localhost:4200'
6+ console . log ( allPosts , allPosts . length )
7+ // const site_url = process.env.VERCEL ? 'https://blog.trialanderror.org' : 'http://localhost:4200'
8+ const site_url = 'https://blog.trialanderror.org'
79
810 const feedOptions : FeedOptions = {
911 updated : new Date ( ) ,
1012 language : 'en' ,
1113 author : {
12- name : 'Center of Trial & Error' ,
14+ name : 'Blog of Center of Trial & Error' ,
1315 email : 'info@trialanderror.org' ,
14- link : 'https://trialanderror.org' ,
16+ link : 'https://blog. trialanderror.org' ,
1517 } ,
1618 ttl : 60 * 60 ,
17- title : 'Center of Trial & Error | RSS Feed' ,
18- description : 'Updates from the Blog, Journal, and Center of Trial & Error!' ,
19+ title : 'Blog of Center of Trial & Error | RSS Feed' ,
20+ description : 'Updates from the Blog of Trial & Error!' ,
1921 id : site_url ,
2022 link : site_url ,
2123 image : `${ site_url } /android-chrome-384x384.png` ,
2224 favicon : `${ site_url } /favicon.ico` ,
2325 copyright : `CC-BY 4.0 ${ new Date ( ) . getFullYear ( ) } , Center of Trial & Error` ,
2426 generator : 'Feed for Node.js' ,
2527 feedLinks : {
26- rss2 : `/rss2 .xml` ,
27- // other feed formats
28- json : `/rss.json` ,
29- atom : `/rss.xml` ,
28+ rss2 : `/rss .xml` ,
29+ // // other feed formats
30+ // json: `/rss.json`,
31+ // atom: `/rss.xml`,
3032 } ,
3133 }
3234
@@ -55,6 +57,7 @@ export async function generateRssFeed(type: 'rss' | 'atom' | 'json' = 'rss') {
5557 description : post . excerpt ,
5658 guid : post . slug ,
5759 content : url ,
60+ // image: post.image?.formats?.thumbnail?.url ?? post.image.url,
5861 category : [
5962 {
6063 term : post . category ?. title ,
@@ -63,6 +66,7 @@ export async function generateRssFeed(type: 'rss' | 'atom' | 'json' = 'rss') {
6366 term : tag . title ,
6467 } ) ) ?? [ ] ) ,
6568 ] ,
69+ // image: 'https://google.com',
6670 ...( image
6771 ? {
6872 image,
0 commit comments