File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ import { getRSS } from "@/lib/rss"
22
33export const revalidate = false
44
5- export function GET ( ) {
6- return new Response ( getRSS ( ) )
5+ export async function GET ( ) {
6+ return new Response ( await getRSS ( ) )
77}
Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ export async function lastEdit(page: Page): Promise<Date> {
2525 owner : "TheNextLvl-net" ,
2626 repo : "docs" ,
2727 token : process . env . GITHUB_TOKEN ,
28- path : `content/docs/${ page . file . path } ` ,
28+ path : `content/docs/${ page . path } ` ,
2929 } ) . catch ( ( error ) => {
3030 console . error ( "Error fetching last edit date:" , error )
31- return new Date ( 0 )
31+ return new Date ( )
3232 } )
3333 return time ? time : new Date ( )
3434}
Original file line number Diff line number Diff line change 11import { Feed } from "feed"
22import { blog } from "@/lib/source"
3+ import { lastEdit } from "@/lib/api"
34
45const baseUrl = "https://thenextlvl.net"
56
6- export function getRSS ( ) {
7+ export async function getRSS ( ) {
78 const feed = new Feed ( {
89 title : "TheNextLvl Blog" ,
910 id : `${ baseUrl } /blog` ,
@@ -22,11 +23,10 @@ export function getRSS() {
2223 title : page . data . title ,
2324 description : page . data . description ,
2425 link : `${ baseUrl } ${ page . url } ` ,
25- date : new Date ( page . data . lastModified ?. getDate ( ) ?? new Date ( ) ) ,
26-
26+ date : await lastEdit ( page ) ,
2727 author : [
2828 {
29- name : "TheNextLvl" ,
29+ name : page . data . author
3030 } ,
3131 ] ,
3232 } )
You can’t perform that action at this time.
0 commit comments