Skip to content

Commit

Permalink
sitemap filter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
manishiwa committed Mar 4, 2024
1 parent fc5fb34 commit f51581a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/(layout)/server-sitemap.xml/route.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
// @ts-ignore
import { ISitemapField, getServerSideSitemap } from "next-sitemap";
import { navigationItems } from "@/lib/navigation";
import { MasterURL } from "@/lib/urls";
import { MasterResponse } from "@/types/api/MasterResponse";

export async function GET(request: Request) {
const fundamentals = navigationItems[1];
const blockspace = navigationItems[2];
const chains = navigationItems[3];
const trackers = navigationItems[5];

const master = await fetch(MasterURL);
const masterData: MasterResponse = await master.json();

const masterChainKeys = Object.keys(masterData.chains);

const pages = [
...fundamentals.options.map(
(option) => `https://www.growthepie.xyz/fundamentals/${option.urlKey}`,
Expand All @@ -16,6 +23,7 @@ export async function GET(request: Request) {
(option) => `https://www.growthepie.xyz/blockspace/${option.urlKey}`,
),
...chains.options
.filter((c) => masterChainKeys.includes(c.urlKey))
.filter((c) => c.hide !== true)
.map((option) => `https://www.growthepie.xyz/chains/${option.urlKey}`),
...trackers.options
Expand Down

0 comments on commit f51581a

Please sign in to comment.