Skip to content
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
6 changes: 6 additions & 0 deletions src/app/bills/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import type { Metadata } from "next";
import { redirect } from "next/navigation";
import { getBillByIdFromDB } from "@/app/bills/server/get-bill-by-id-from-db";
import { requireAuthenticatedUser } from "@/app/bills/lib/auth-guards";
import { BASE_PATH } from "@/app/bills/utils/basePath";
import { Button } from "@/components/ui/button";
import { ReprocessButton } from "@/app/bills/components/ReprocessButton/reprocess-button.component";

export const metadata: Metadata = {
title: "Edit Bill",
robots: { index: false, follow: false, googleBot: { index: false, follow: false } },
};

interface Params {
params: Promise<{ id: string }>;
}
Expand Down
6 changes: 4 additions & 2 deletions src/app/bills/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const metadata: Metadata = {
default: PROJECT_NAME,
template: `%s · ${PROJECT_NAME}`,
},
description: "Understand Canadian Federal Bills",
description:
"Builder MP: Canadian federal bills summarized and judged through a builder-first lens.",
openGraph: {
type: "website",
siteName: PROJECT_NAME,
Expand All @@ -36,7 +37,8 @@ export const metadata: Metadata = {
site: BUILD_CANADA_TWITTER_HANDLE,
creator: BUILD_CANADA_TWITTER_HANDLE,
title: PROJECT_NAME,
description: "Understand Canadian Federal Bills",
description:
"Builder MP: Canadian federal bills summarized and judged through a builder-first lens.",
images: ["https://buildcanada.com/bills/builder-mp-seo-image.png"],
},
};
Expand Down
45 changes: 40 additions & 5 deletions src/app/bills/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import type { Metadata } from "next";
import { headers } from "next/headers";
import { env } from "@/app/bills/env";
import { buildRelativePath } from "@/app/bills/utils/basePath";
import { BUILD_CANADA_TWITTER_HANDLE, PROJECT_NAME } from "@/app/bills/consts/general";
import {
BUILD_CANADA_TWITTER_HANDLE,
BUILD_CANADA_URL,
PROJECT_NAME,
} from "@/app/bills/consts/general";
import FAQModalTrigger from "./FAQModalTrigger";
import { PageHeader } from "@/components/ui/page-header";

Expand All @@ -25,9 +29,11 @@ export const dynamic = "auto";
export const revalidate = 120; // seconds - cache page data

export async function generateMetadata(): Promise<Metadata> {
const title = "Home";
const title = {
absolute: `${PROJECT_NAME} — Canadian Federal Bills Tracker | Build Canada`,
};
const description =
"Understand Canadian federal bills with builder-first analysis.";
"Builder MP tracks every bill before Canada's House of Commons and Senate, summarized and judged through a builder-first lens.";
const h = headers();
const headerList = await h;
const host =
Expand All @@ -44,6 +50,14 @@ export async function generateMetadata(): Promise<Metadata> {
return {
title,
description,
keywords: [
"Builder MP",
"Canadian federal bills",
"Parliament of Canada bills",
"bill tracker Canada",
"45th Parliament",
"Build Canada",
],
alternates: { canonical: pageUrl },
openGraph: {
title: PROJECT_NAME,
Expand Down Expand Up @@ -221,11 +235,32 @@ export default async function Home({
clearMergedBillsCache(); // Allow manual cache busting with ?cache=clear
}
const bills = await getMergedBillsCached();
const jsonLd = {
"@context": "https://schema.org",
"@type": "WebApplication",
name: PROJECT_NAME,
alternateName: "Builder MP by Build Canada",
url: `${BUILD_CANADA_URL}${buildRelativePath()}`,
description:
"Builder MP tracks every bill before Canada's House of Commons and Senate, summarized and judged through a builder-first lens.",
applicationCategory: "GovernmentApplication",
operatingSystem: "Web",
isAccessibleForFree: true,
publisher: {
"@type": "Organization",
name: "Build Canada",
url: BUILD_CANADA_URL,
},
};
return (
<div className="mx-[10px] my-[10px] border border-border-light bg-bg">
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<PageHeader
title={<>Bills &mdash; The 45th Parliament</>}
description="Every federal bill before the House and the Senate, summarized and weighed against a pro-growth standard."
title={<>{PROJECT_NAME} &mdash; Bills of the 45th Parliament</>}
description="Every federal bill before the House and the Senate, summarized and weighed against a builder-first standard"
action={<FAQModalTrigger />}
/>
<BillExplorer bills={bills} />
Expand Down
14 changes: 14 additions & 0 deletions src/app/bills/sign-in/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Metadata } from "next";

// Auth pages must never be indexed — they were outranking the bills listing
// for "Builder MP" because they inherited the layout's default title.
export const metadata: Metadata = {
title: "Sign in",
robots: { index: false, follow: false, googleBot: { index: false, follow: false } },
};

export default function SignInLayout({
children,
}: Readonly<{ children: React.ReactNode }>) {
return children;
}
12 changes: 12 additions & 0 deletions src/app/bills/unauthorized/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Unauthorized",
robots: { index: false, follow: false, googleBot: { index: false, follow: false } },
};

export default function UnauthorizedLayout({
children,
}: Readonly<{ children: React.ReactNode }>) {
return children;
}
1 change: 1 addition & 0 deletions src/app/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default function robots(): MetadataRoute.Robots {
disallow: [
"/admin",
"/api/",
"/bills/api/",
"/toronto/vote/survey-questions",
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
{ url: `${baseUrl}/tracker/commitments`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.7 },
{ url: `${baseUrl}/tracker/faq`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.4 },
{ url: `${baseUrl}/builders`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.7 },
{ url: buildAbsoluteUrl(baseUrl), lastModified: new Date(), changeFrequency: "daily", priority: 0.8 },
{ url: buildAbsoluteUrl(baseUrl), lastModified: new Date(), changeFrequency: "daily", priority: 0.9 },
{ url: `${baseUrl}/about`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.5 },
{ url: `${baseUrl}/constitution`, lastModified: new Date(), changeFrequency: "yearly", priority: 0.5 },
{ url: `${baseUrl}/privacy-notice`, lastModified: new Date(), changeFrequency: "yearly", priority: 0.3 },
Expand Down
Loading