#create a sitemap for my blog site hosted on vercel how?
10 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
If you want to create a sitemap dynamically you could create a sitemap.ts file and place your logic there.
Example:
import { API_URL, SITE_URL } from "@/utils/constants";
import { MetadataRoute } from "next";export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const data = await fetch(${API_URL}/user/usernames);
let usernames = ["dummyuser"];
if (data.ok) usernames = await data.json();return usernames.map((username: string) => {
return {
url:${SITE_URL}/${username},
changeFrequency: "weekly",
};
});
}
should i place in the root folder?
inside app folder
is your issue resolved?, if yes please mark the response as answer.