The admin functionality related code has been removed which includes various user and organization functionalities like delete, update, ban etc. This includes action logic, UI components and supportive utility functions. Notable deletions include the server action files, dialog components for actions like banning and deleting, and related utility functions. This massive cleanup is aimed at simplifying the codebase and the commit reflects adherence to project restructuring.
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import { invariant } from '@epic-web/invariant';
|
|
import { allDocumentationPages, allPosts } from 'contentlayer/generated';
|
|
import { getServerSideSitemap } from 'next-sitemap';
|
|
|
|
import appConfig from '~/config/app.config';
|
|
|
|
const siteUrl = appConfig.url;
|
|
|
|
export async function GET() {
|
|
const urls = getSiteUrls();
|
|
const posts = getPostsSitemap();
|
|
const docs = getDocsSitemap();
|
|
|
|
return getServerSideSitemap([...urls, ...posts, ...docs]);
|
|
}
|
|
|
|
function getSiteUrls() {
|
|
invariant(siteUrl, 'No NEXT_PUBLIC_SITE_URL found');
|
|
|
|
const urls = ['', 'faq', 'pricing'];
|
|
|
|
return urls.map((url) => {
|
|
return {
|
|
loc: new URL(siteUrl, url).href,
|
|
lastmod: new Date().toISOString(),
|
|
};
|
|
});
|
|
}
|
|
|
|
function getPostsSitemap() {
|
|
invariant(siteUrl, 'No NEXT_PUBLIC_SITE_URL found');
|
|
|
|
return allPosts.map((post) => {
|
|
return {
|
|
loc: new URL(siteUrl, post.url).href,
|
|
lastmod: new Date().toISOString(),
|
|
};
|
|
});
|
|
}
|
|
|
|
function getDocsSitemap() {
|
|
invariant(siteUrl, 'No NEXT_PUBLIC_SITE_URL found');
|
|
|
|
return allDocumentationPages.map((page) => {
|
|
return {
|
|
loc: new URL(siteUrl, page.url).href,
|
|
lastmod: new Date().toISOString(),
|
|
};
|
|
});
|
|
}
|