@@ -168,7 +168,7 @@ export function createRecentUpdatesLoader(options?: RecentUpdatesContentLoaderOp
168168
169169 return {
170170 async load ( ) {
171- const files = await glob ( join ( opts . dir , '**/*.md' ) , {
171+ const files = await glob ( join ( opts . dir , '**/*.md' ) . replaceAll ( '\\' , '/' ) , {
172172 absolute : true ,
173173 cwd : cwd ( ) ,
174174 ignore : opts . ignores ,
@@ -215,24 +215,27 @@ export function createRecentUpdatesLoader(options?: RecentUpdatesContentLoaderOp
215215 }
216216 }
217217
218- let url = relative ( cwd ( ) , file )
219- if ( url . endsWith ( '.md' ) ) {
220- if ( url . endsWith ( 'index.md' ) ) {
221- url = url . replace ( / i n d e x \. m d $ / , 'index.html' )
218+ let url = ''
219+ const fileRelativePath = relative ( cwd ( ) , file )
220+
221+ if ( fileRelativePath . endsWith ( '.md' ) ) {
222+ if ( fileRelativePath . endsWith ( 'index.md' ) ) {
223+ url = fileRelativePath . replace ( / i n d e x \. m d $ / , 'index.html' )
222224 }
223225 else {
224- url = url . replace ( / \. m d $ / , '.html' )
226+ url = fileRelativePath . replace ( / \. m d $ / , '.html' )
225227 }
226228 }
227229
228230 for ( const rewrite of opts . rewrites ) {
229231 url = url . replace ( rewrite . from , rewrite . to )
230232 }
233+ url = `/${ url } `
231234
232235 const entry = {
233236 title,
234237 lastUpdated : lastUpdatedTimestamp ,
235- filePath : relative ( cwd ( ) , file ) ,
238+ filePath : fileRelativePath ,
236239 category : '' ,
237240 url,
238241 }
0 commit comments