Skip to content

Commit

Permalink
sitemap fixes, update redirects for (icons), update (icons) metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
manishiwa committed Jan 9, 2025
1 parent ad76d4e commit a0dc6e1
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 44 deletions.
33 changes: 17 additions & 16 deletions app/(icons)/icons/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const jsonLd: Graph = {
],
};


// const jsonLd = [jsonLdOrg, jsonLdWebSite];
export const viewport = {
width: "device-width",
Expand All @@ -63,31 +62,32 @@ const gtpMain = {
"At growthepie, our mission is to provide comprehensive and accurate analytics of layer 2 solutions for the Ethereum ecosystem, acting as a trusted data aggregator from reliable sources such as L2Beat and DefiLlama, while also developing our own metrics.",
};

const gtpLabels = {
const gtpIcons = {
title: {
absolute: "Ethereum Layer 2 Labels - growthepie",
absolute: "Open Source Icons - growthepie",
template: "%s - growthepie",
},
description:
"Labels for Ethereum Layer 2 solutions - growthepie. A comprehensive list of labels for Ethereum Layer 2 solutions.",
"Explore and download open source icons from growthepie. Freely available icons designed for the Ethereum ecosystem and beyond.",
};

const isLabels =
const isIcons =
process.env.NEXT_PUBLIC_VERCEL_URL &&
process.env.NEXT_PUBLIC_VERCEL_URL.includes("labels.");
process.env.NEXT_PUBLIC_VERCEL_URL.includes("icons.");

const host = isLabels ? "labels.growthepie.xyz" : "www.growthepie.xyz";
const host = isIcons ? "icons.growthepie.xyz" : "www.growthepie.xyz";

const title = isLabels ? gtpLabels.title : gtpMain.title;
const description = isLabels ? gtpLabels.description : gtpMain.description;
const title = isIcons ? gtpIcons.title : gtpMain.title;
const description = isIcons ? gtpIcons.description : gtpMain.description;

export const metadata: Metadata = {
metadataBase: new URL(`https://${host}`),
title,
description,
openGraph: {
title: "growthepie",
description: "Growing Ethereum’s Ecosystem Together",
title: "Open Source Icons - growthepie",
description:
"Explore and download open source icons from growthepie. Freely available icons designed for the Ethereum ecosystem and beyond.",
url: `https://${host}`,
images: [
{
Expand All @@ -102,8 +102,9 @@ export const metadata: Metadata = {
},
twitter: {
card: "summary_large_image",
title: "growthepie.xyz",
description: "Growing Ethereum’s Ecosystem Together",
title: "icons.growthepie.xyz",
description:
"Explore and download open source icons from growthepie. Freely available icons designed for the Ethereum ecosystem and beyond.",
site: "@growthepie_eth",
siteId: "1636391104689094656",
creator: "@growthepie_eth",
Expand Down Expand Up @@ -156,14 +157,14 @@ export default function RootLayout({
suppressHydrationWarning
>
<Head />
<body className="bg-forest-50 dark:bg-[#1F2726] text-forest-900 dark:text-forest-500">
<body className="bg-forest-50 text-forest-900 dark:bg-[#1F2726] dark:text-forest-500">
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<Providers forcedTheme="dark">
<MasterProvider>
<main className="font-raleway relative flex-1 w-full mx-auto min-h-screen select-none">
<main className="relative mx-auto min-h-screen w-full flex-1 select-none font-raleway">
<div className="background-container !fixed">
<div className="background-gradient-group">
<div className="background-gradient-yellow"></div>
Expand All @@ -177,6 +178,6 @@ export default function RootLayout({
<CookieConsent />
</Providers>
</body>
</html >
</html>
);
}
76 changes: 48 additions & 28 deletions app/(layout)/server-sitemap.xml/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,59 @@ export async function GET(request: Request) {

const fundamentals = navigationItems[1];
const blockspace = navigationItems[2];
const trackers = navigationItems[3];
const dataAvailability = navigationItems[3];
const trackers = navigationItems[4];

const chains = Get_AllChainsNavigationItems(masterData);

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

const pages = [
...fundamentals.options
.filter((c) => c.excludeFromSitemap !== true)
.map(
(option) => `https://www.growthepie.xyz/fundamentals/${option.urlKey}`,
),
...blockspace.options
.filter((c) => c.excludeFromSitemap !== true)
.map(
(option) => `https://www.growthepie.xyz/blockspace/${option.urlKey}`,
),
...Object.keys(masterData.blockspace_categories.main_categories).map(
(category) =>
`https://www.growthepie.xyz/blockspace/chain-overview/${category}`,
),
...chains.options
.filter(
(c) =>
c.key &&
Get_SupportedChainKeys(masterData).includes(c.key) &&
c.excludeFromSitemap !== true,
)
.map((option) => `https://www.growthepie.xyz/chains/${option.urlKey}`),
...trackers.options
.filter((c) => c.hide !== true && c.excludeFromSitemap !== true)
.map((option) => `https://www.growthepie.xyz/trackers/${option.urlKey}`),
];
// const pages = [
// ...fundamentals.options
// .filter((c) => c.excludeFromSitemap !== true)
// .map(
// (option) => `https://www.growthepie.xyz/fundamentals/${option.urlKey}`,
// ),
// ...blockspace.options
// .filter((c) => c.excludeFromSitemap !== true)
// .map(
// (option) => `https://www.growthepie.xyz/blockspace/${option.urlKey}`,
// ),
// ...Object.keys(masterData.blockspace_categories.main_categories).map(
// (category) =>
// `https://www.growthepie.xyz/blockspace/chain-overview/${category}`,
// ),
// ...chains.options
// .filter(
// (c) =>
// c.key &&
// Get_SupportedChainKeys(masterData).includes(c.key) &&
// c.excludeFromSitemap !== true,
// )
// .map((option) => `https://www.growthepie.xyz/chains/${option.urlKey}`),
// ...dataAvailability.options
// .filter((c) => c.excludeFromSitemap !== true)
// .map(
// (option) =>
// `https://www.growthepie.xyz/data-availability/${option.urlKey}`,
// ),
// ...trackers.options
// .filter((c) => c.hide !== true && c.excludeFromSitemap !== true)
// .map((option) => `https://www.growthepie.xyz/trackers/${option.urlKey}`),
// ];

const pages = navigationItems
.map((item) => {
return item.options
.filter(
(option) =>
option.excludeFromSitemap !== true &&
option.url &&
!option.url.includes("https://"),
)
.map((option) => `https://www.growthepie.xyz${option.url}`);
})
.flat();

const getDate = () => {
const date = new Date();
Expand Down
25 changes: 25 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ const nextConfig = {
],
destination: "/labels",
},
,
{
source: "/",
has: [
{
type: "host",
value: "icons.growthepie.xyz",
},
],
destination: "/icons",
},
{
source: "/",
has: [
{
type: "host",
value: "dev.icons.growthepie.xyz",
},
],
destination: "/icons",
},
],
};
},
Expand Down Expand Up @@ -112,6 +133,10 @@ const nextConfig = {
protocol: "https",
hostname: "content.optimism.io",
},
{
protocol: "https",
hostname: "api.growthepie.xyz",
},
],
},
};
Expand Down

0 comments on commit a0dc6e1

Please sign in to comment.