1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 17:26:37 -04:00

extract metadata merging logic from each page into a helper function

This commit is contained in:
2025-03-14 20:16:27 -04:00
parent 6e572a8f48
commit 5ca7e6cb22
19 changed files with 211 additions and 245 deletions

View File

@ -1,27 +1,21 @@
import Link from "../../components/Link";
import Time from "../../components/Time";
import { getAllPosts } from "../../lib/helpers/posts";
import { addMetadata } from "../../lib/helpers/metadata";
import * as config from "../../lib/config";
import { metadata as defaultMetadata } from "../layout";
import type { ReactElement } from "react";
import type { Metadata, Route } from "next";
import type { Route } from "next";
import type { FrontMatter } from "../../lib/helpers/posts";
import styles from "./page.module.css";
export const metadata: Metadata = {
export const metadata = addMetadata({
title: "Notes",
description: `Recent posts by ${config.authorName}.`,
openGraph: {
...defaultMetadata.openGraph,
title: "Notes",
url: "/notes",
},
alternates: {
...defaultMetadata.alternates,
canonical: "/notes",
},
};
});
const Page = async () => {
// parse the year of each note and group them together