The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

dynamic sidemap

Luna f7e94028 add0e10c

+82 -47
+79
app/sitemap.xml/route.ts
··· 1 + import { getCanonicalUrl } from "@/utils/urls"; 2 + 3 + type Sitemap = { 4 + url: string 5 + priority: number 6 + }[] 7 + 8 + // Update sitemap only one a day 9 + // export const revalidate = 1000 * 60 * 60 * 24; 10 + 11 + export async function GET() { 12 + const guildIds = await fetch(`${process.env.NEXT_PUBLIC_API}/guilds`, { headers: { Authorization: process.env.API_SECRET as string }, next: { revalidate: 60 * 12 } }).then((res) => res.json()) as string[]; 13 + 14 + const sitemap = [ 15 + { 16 + url: getCanonicalUrl(), 17 + priority: 1 18 + }, 19 + { 20 + url: getCanonicalUrl("bot", "pronouns"), 21 + priority: 0.9 22 + }, 23 + { 24 + url: getCanonicalUrl("bot", "pronouns", "pronouns"), 25 + priority: 0.9 26 + }, 27 + { 28 + url: getCanonicalUrl("bot", "pronouns", "sexualities"), 29 + priority: 0.9 30 + }, 31 + { 32 + url: getCanonicalUrl("bot", "pronouns", "genders"), 33 + priority: 0.9 34 + }, 35 + { 36 + url: getCanonicalUrl("dashboard"), 37 + priority: 0.8 38 + }, 39 + { 40 + url: getCanonicalUrl("profile"), 41 + priority: 0.8 42 + }, 43 + { 44 + url: getCanonicalUrl("support"), 45 + priority: 0.7 46 + }, 47 + { 48 + url: getCanonicalUrl("login"), 49 + priority: 0.5 50 + }, 51 + { 52 + url: getCanonicalUrl("terms"), 53 + priority: 0.2 54 + }, 55 + { 56 + url: getCanonicalUrl("privacy"), 57 + priority: 0.2 58 + } 59 + ] as Sitemap; 60 + 61 + for (const guildId of guildIds) sitemap.push({ url: getCanonicalUrl("leaderboard", guildId), priority: 0.6 }); 62 + 63 + return new Response(` 64 + <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 65 + ${sitemap.map((site) => ` 66 + <url> 67 + <loc>${site.url}</loc> 68 + <lastmod>${new Date().toISOString()}</lastmod> 69 + <changefreq>daily</changefreq> 70 + <priority>${site.priority}</priority> 71 + </url> 72 + `)} 73 + </urlset>` 74 + .replaceAll(",", ""), { 75 + headers: { 76 + "Content-Type": "text/xml" 77 + } 78 + }); 79 + }
+3 -1
public/robots.txt
··· 1 1 User-Agent: * 2 - Allow: / 2 + Allow: / 3 + 4 + Sitemap: https://wamellow.com/sitemap.xml
-46
public/sitemap.xml
··· 1 - <?xml version="1.0" encoding="UTF-8"?> 2 - <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"> 3 - <url> 4 - <loc>https://wamellow.com</loc> 5 - <changefreq>daily</changefreq> 6 - <priority>1</priority> 7 - <image:image> 8 - <image:loc>https://wamellow.com/waya-v3.jpg</image:loc> 9 - </image:image> 10 - </url> 11 - <url> 12 - <loc>https://wamellow.com/new-waya</loc> 13 - <changefreq>weekly</changefreq> 14 - <priority>0.9</priority> 15 - </url> 16 - <url> 17 - <loc>https://wamellow.com/dashboard</loc> 18 - <changefreq>daily</changefreq> 19 - <priority>0.8</priority> 20 - </url> 21 - <url> 22 - <loc>https://wamellow.com/profile</loc> 23 - <changefreq>daily</changefreq> 24 - <priority>0.8</priority> 25 - </url> 26 - <url> 27 - <loc>https://wamellow.com/login</loc> 28 - <changefreq>weekly</changefreq> 29 - <priority>0.2</priority> 30 - </url> 31 - <url> 32 - <loc>https://wamellow.com/support</loc> 33 - <changefreq>weekly</changefreq> 34 - <priority>0.2</priority> 35 - </url> 36 - <url> 37 - <loc>https://wamellow.com/terms</loc> 38 - <changefreq>weekly</changefreq> 39 - <priority>0.1</priority> 40 - </url> 41 - <url> 42 - <loc>https://wamellow.com/privacy</loc> 43 - <changefreq>weekly</changefreq> 44 - <priority>0.1</priority> 45 - </url> 46 - </urlset>