-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38fbce0
commit 9e4baff
Showing
13 changed files
with
167 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,6 @@ const AboutPage = () => ( | |
</header> | ||
<GeneralDescription /> | ||
</> | ||
) | ||
); | ||
|
||
export default AboutPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export async function GET() { | ||
return Response.json({ status: "ok" }) | ||
} | ||
return Response.json({ status: 'ok' }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import RSS from 'rss'; | ||
import { parse } from 'date-fns'; | ||
import { getAllArticles } from '../../lib/article'; | ||
|
||
export async function GET() { | ||
const articles = getAllArticles([ | ||
'date', | ||
'draft', | ||
'slug', | ||
'title', | ||
'image', | ||
'content', | ||
'language', | ||
'description', | ||
]).filter((article) => !article.draft); | ||
|
||
const feed = new RSS({ | ||
title: 'Ivan Santos', | ||
description: "Ivan Santos's Blog", | ||
generator: 'RSS for Node and Next.js', | ||
feed_url: 'https://ivansantos.me/feed.xml', | ||
site_url: 'https://ivansantos.me/', | ||
copyright: `Copyright ${new Date().getFullYear().toString()}, Ivan Santos`, | ||
language: 'en-US', | ||
pubDate: new Date().toUTCString(), | ||
ttl: 60, | ||
}); | ||
|
||
if (articles) { | ||
for (const article of articles) { | ||
feed.item({ | ||
title: article.title ?? '', | ||
description: article.description ?? '', | ||
url: `https://ivansantos.me/blog/${article.slug}/`, | ||
author: 'Ivan Santos', | ||
date: parse( | ||
article.date ?? new Date().toDateString(), | ||
'yyyy-MM-dd', | ||
new Date() | ||
), | ||
}); | ||
} | ||
} | ||
|
||
return new Response(feed.xml({ indent: true }), { | ||
headers: { | ||
'Content-Type': 'application/xml; charset=utf-8', | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters