Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indexing bug #1232

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,21 @@ export const metadata = {
],
metadataBase: new URL("https://www.codu.co"),
openGraph: {
images: "/images/og/home-og.png",
title: "Codú - The Web Developer Community",
description:
"A free network and community for web developers. Learn and grow together.",
url: "https://www.codu.co",
siteName: "Codú",
images: [
{
url: "https://www.codu.co/images/og/home-og.png",
width: 1200,
height: 630,
alt: "Codú Community",
},
],
locale: "en_US",
type: "website",
},
};

Expand Down
3 changes: 2 additions & 1 deletion app/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function robots(): MetadataRoute.Robots {
"/notifications/",
"/create/",
"/my-posts/",
"/hub/", // This should be crawled when completed
"/hub/",
"/api/og",
],
},
sitemap: "https://www.codu.co/sitemap.xml",
Expand Down
8 changes: 4 additions & 4 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
}));

// Shape and connect all the data
const data = [
const allRoutes = [
{
url: BASE_URL,
lastModified: new Date(),
},
...routes,
...articles,
...users,
];
].filter((route) => !route.url.includes("/api/og")); // Filter out OG routes

// Capture data as sitemap has been inconsistent and want to test on dev
Sentry.captureMessage(
`${JSON.stringify(data)}; Routes Count = ${
`${JSON.stringify(allRoutes)}; Routes Count = ${
routes.length
}, Articles Count = ${articles.length}, Users Count = ${users.length}`,
);

return data;
return allRoutes;
}
Loading