You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
810 B
TypeScript
31 lines
810 B
TypeScript
import { MetadataRoute } from 'next';
|
|
|
|
import { SitemapType, sitemapModule } from '@/server/sitemap';
|
|
|
|
export const generateSitemaps = async () => {
|
|
// Fetch the total number of products and calculate the number of sitemaps needed
|
|
return sitemapModule.sitemapIndexs;
|
|
};
|
|
|
|
const Sitemap = async ({ id }: { id: SitemapType }): Promise<MetadataRoute.Sitemap> => {
|
|
switch (id) {
|
|
case SitemapType.Pages: {
|
|
return sitemapModule.getPage();
|
|
}
|
|
case SitemapType.Assistants: {
|
|
return sitemapModule.getAssistants();
|
|
}
|
|
case SitemapType.Plugins: {
|
|
return sitemapModule.getPlugins();
|
|
}
|
|
case SitemapType.Models: {
|
|
return sitemapModule.getModels();
|
|
}
|
|
case SitemapType.Providers: {
|
|
return sitemapModule.getProviders();
|
|
}
|
|
}
|
|
};
|
|
|
|
export default Sitemap;
|