File tree Expand file tree Collapse file tree 2 files changed +9
-27
lines changed
app/apis/[providerSlug]/[serviceSlug] Expand file tree Collapse file tree 2 files changed +9
-27
lines changed Original file line number Diff line number Diff line change @@ -130,13 +130,16 @@ export async function generateStaticParams() {
130130 for ( const key in apiList ) {
131131 if ( Object . prototype . hasOwnProperty . call ( apiList , key ) ) {
132132 const [ provider , service ] = key . split ( ":" ) ;
133- const providerSlug = provider . toLowerCase ( ) ;
134- const serviceSlug = service ? service . toLowerCase ( ) : providerSlug ;
135133
136- params . push ( {
137- providerSlug,
138- serviceSlug,
139- } ) ;
134+ if ( service ) {
135+ const providerSlug = provider . toLowerCase ( ) ;
136+ const serviceSlug = service . toLowerCase ( ) ;
137+
138+ params . push ( {
139+ providerSlug,
140+ serviceSlug,
141+ } ) ;
142+ }
140143 }
141144 }
142145
Original file line number Diff line number Diff line change 1- import list from "./list.json" ;
2-
3- const getProviderOnlyRoutes = ( ) => {
4- const providerOnlyRoutes = new Set ( ) ;
5-
6- for ( const key of Object . keys ( list ) ) {
7- const [ provider , service ] = key . split ( ":" ) ;
8- if ( ! service ) {
9- const providerSlug = provider . toLowerCase ( ) ;
10- providerOnlyRoutes . add ( `/apis/${ providerSlug } /${ providerSlug } ` ) ;
11- }
12- }
13-
14- return providerOnlyRoutes ;
15- } ;
16-
17- const providerOnlyRoutes = getProviderOnlyRoutes ( ) ;
18-
191/** @type {import('next-sitemap').IConfig } */
202module . exports = {
213 siteUrl : process . env . SITE_URL || "https://apis.guru" ,
@@ -24,9 +6,6 @@ module.exports = {
246 exclude : [ "/studio/*" , "/api/*" , "/blog/*" ] ,
257
268 transform : async ( config , path ) => {
27- if ( providerOnlyRoutes . has ( path ) ) {
28- return null ;
29- }
309 return {
3110 loc : path ,
3211 changefreq : config . changefreq || "daily" ,
You can’t perform that action at this time.
0 commit comments