mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-08-22 08:34:13 -05:00
Add canonical urls
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
import DiscoverBrowser from "@/components/Discover/DiscoverBrowser";
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
alternates: {
|
||||
canonical: "/discover",
|
||||
},
|
||||
};
|
||||
|
||||
export default function DiscoverPage() {
|
||||
return (
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import React from "react";
|
||||
import type { Metadata } from "next";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import rehypeSlug from "rehype-slug";
|
||||
import entriesMd from "./entries.md";
|
||||
|
||||
export const metadata = {
|
||||
export const metadata: Metadata = {
|
||||
title: "FAQ",
|
||||
description: "Frequently asked questions about Hackdex, how it works, and what makes it unique.",
|
||||
alternates: {
|
||||
canonical: "/faq",
|
||||
},
|
||||
};
|
||||
|
||||
export default function FAQPage() {
|
||||
|
||||
@@ -39,14 +39,7 @@ export async function generateMetadata({ params }: HackDetailProps): Promise<Met
|
||||
.maybeSingle();
|
||||
const author = profile?.username ? `@${profile.username}` : undefined;
|
||||
|
||||
// Build canonical and page URLs
|
||||
const hdrs = await headers();
|
||||
const siteBase = process.env.NEXT_PUBLIC_SITE_URL ? process.env.NEXT_PUBLIC_SITE_URL.replace(/\/$/, "") : "";
|
||||
const proto = siteBase ? "" : (hdrs.get("x-forwarded-proto") || "https");
|
||||
const host = siteBase ? "" : (hdrs.get("host") || "");
|
||||
const baseUrl = siteBase || (proto && host ? `${proto}://${host}` : "");
|
||||
const pageUrl = baseUrl ? `${baseUrl}/hack/${slug}` : `/hack/${slug}`;
|
||||
|
||||
const pageUrl = `/hack/${slug}`;
|
||||
const title = `${hack.title} hack download | A ${baseRomName} ROM fan game`;
|
||||
const description = `Play ${hack.title}, a fan-made Pokémon ROM hack for ${baseRomName}. ${hack.summary}`;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ export const metadata: Metadata = {
|
||||
template: "%s | Hackdex",
|
||||
},
|
||||
description: "Discover and download Pokémon rom hacks.",
|
||||
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL!),
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { FaArrowRightLong } from "react-icons/fa6";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
alternates: {
|
||||
canonical: "/",
|
||||
},
|
||||
};
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import React from "react";
|
||||
import type { Metadata } from "next";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import rehypeSlug from "rehype-slug";
|
||||
import privacyMd from "@/../docs/legal/PRIVACY.md";
|
||||
|
||||
export const metadata = {
|
||||
export const metadata: Metadata = {
|
||||
title: "Privacy Policy",
|
||||
alternates: {
|
||||
canonical: "/privacy",
|
||||
},
|
||||
};
|
||||
|
||||
export default function PrivacyPage() {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import HackForm from "@/components/Hack/HackForm";
|
||||
import { createClient } from "@/utils/supabase/server";
|
||||
import SubmitAuthOverlay from "@/components/Submit/SubmitAuthOverlay";
|
||||
import { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
alternates: {
|
||||
canonical: "/submit",
|
||||
},
|
||||
};
|
||||
|
||||
export default async function SubmitPage() {
|
||||
const supabase = await createClient();
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import React from "react";
|
||||
import type { Metadata } from "next";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import rehypeSlug from "rehype-slug";
|
||||
import termsMd from "@/../docs/legal/TERMS.md";
|
||||
|
||||
export const metadata = {
|
||||
export const metadata: Metadata = {
|
||||
title: "Terms of Service",
|
||||
alternates: {
|
||||
canonical: "/terms",
|
||||
},
|
||||
};
|
||||
|
||||
export default function TermsPage() {
|
||||
|
||||
Reference in New Issue
Block a user