File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/skin-database/app Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ const PAGE_SIZE = 50000;
66
77const BASE_URL = "https://skins.webamp.org" ;
88
9- export async function generateSitemaps ( ) : Promise < { id : number } [ ] > {
9+ export const dynamic = "force-dynamic" ; // This ensures the sitemap is always generated fresh
10+
11+ export async function generateSitemaps ( ) : Promise < { id : string } [ ] > {
1012 const count = await Skins . getClassicSkinCount ( ) ;
11- const maps : { id : number } [ ] = [ ] ;
13+ const maps : { id : string } [ ] = [ ] ;
1214 for ( let i = 0 ; i < Math . ceil ( count / PAGE_SIZE ) ; i ++ ) {
13- maps . push ( { id : i } ) ;
15+ maps . push ( { id : String ( i ) } ) ;
1416 }
1517 return maps ;
1618}
@@ -21,7 +23,9 @@ export default async function sitemap({
2123 id : string ;
2224} ) : Promise < MetadataRoute . Sitemap > {
2325 const md5s = await Skins . getAllClassicSkins ( ) ;
24- const skinUrls = md5s . map ( ( { md5, fileName } ) => `skin/${ md5 } /${ fileName } ` ) ;
26+ const skinUrls = md5s . map (
27+ ( { md5, fileName } ) => `/skin/${ md5 } /${ encodeURIComponent ( fileName ) } `
28+ ) ;
2529 const urls = [ "/about" , "/" , "/upload" , ...skinUrls ] ;
2630 const slice = urls . slice (
2731 parseInt ( id , 10 ) * PAGE_SIZE ,
You can’t perform that action at this time.
0 commit comments