Reorganise code - use src folder

This commit is contained in:
Timothy Armes
2023-10-11 08:45:36 +02:00
committed by Owen Rees
parent 2dc5f477c9
commit b5061b1c78
89 changed files with 70 additions and 69 deletions
+28
View File
@@ -0,0 +1,28 @@
import { MetadataRoute } from "next";
import { locales, pathnames } from "@/utils/navigation";
export default function sitemap(): MetadataRoute.Sitemap {
return locales.flatMap((locale) => {
const prefix = `https://echecsfrance.com${
locale === "fr" ? "" : `/${locale}`
}`;
const paths = Object.keys(pathnames) as Array<keyof typeof pathnames>;
return paths.map((pathname) => {
const route = pathnames[pathname];
if (typeof route === "string") {
return {
url: `${prefix}${route}`,
lastModified: new Date(),
};
}
return {
url: `${prefix}${route[locale]}`,
lastModified: new Date(),
};
});
});
}