forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsitemap.tsx
30 lines (26 loc) · 810 Bytes
/
sitemap.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;