Skip to content

Commit 780d52d

Browse files
committed
fix: fix changelogs
1 parent f6e8d89 commit 780d52d

File tree

6 files changed

+8
-13
lines changed

6 files changed

+8
-13
lines changed

app/changelog/[...slug]/page.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Metadata, ResolvingMetadata } from "next";
1+
import { Metadata } from "next";
22
import { notFound } from "next/navigation";
33
import * as React from "react";
44

55
import { getChangelogEntryBySlug, getChangelogs } from "@/lib/changelog-api";
66

7-
import Changelogs from "../changelogs";
7+
import { Changelogs } from "../changelogs";
88

99
type Props = {
1010
params: { slug: string[] };
@@ -59,10 +59,6 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
5959
};
6060
}
6161

62-
const dateFormatter = new Intl.DateTimeFormat("en-US", {
63-
dateStyle: "long",
64-
});
65-
6662
export default async function Page({ params }: Props) {
6763
const changelog = await getChangelogFromParams(params);
6864
if (!changelog) {

app/changelog/changelogs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const dateFormatter = new Intl.DateTimeFormat("en-US", {
88
dateStyle: "long",
99
});
1010

11-
export default function Changelogs(props: {
11+
export function Changelogs(props: {
1212
changelogs: ChangelogEntry[];
1313
single?: boolean;
1414
}) {

app/changelog/page.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { Metadata } from "next";
22

3-
import { Container } from "@/components/Container";
4-
import { Link } from "@/components/Link";
53
import { getChangelogs } from "@/lib/changelog-api";
64
import { getMetadata } from "@/lib/metadata";
75

8-
import Changelogs from "./changelogs";
6+
import { Changelogs } from "./changelogs";
97

108
export const metadata: Metadata = getMetadata({
119
title: "Changelog",

app/changelog/sitemap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default async function sitemap({
1111
}): Promise<MetadataRoute.Sitemap> {
1212
const changelogs = await getChangelogs();
1313
return changelogs.map((changelog) => ({
14-
url: `${BASE_URL}/changelogs/${changelog.slug}`,
14+
url: `${BASE_URL}/changelog/${changelog.slug}`,
1515
lastModified: changelog.date,
1616
}));
1717
}

lib/changelog-api.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ async function getChangelogFromPath(
6161
.replace(/^.\/changelogs\//, "")
6262
.replace(/\/index.mdx$/, "");
6363

64-
const DD_MM_YYYY = frontmatter.date.toISOString().split("T")[0];
64+
const YYYY_MM_DD = frontmatter.date.toISOString().split("T")[0];
6565
return {
6666
filepath,
6767
title: frontmatter.title,
6868
description: frontmatter.description,
69-
slug: `${DD_MM_YYYY}-${slug}`,
69+
slug: `${YYYY_MM_DD}-${slug}`,
7070
date: frontmatter.date.toISOString(),
7171
source: await getDocMdxSource(filepath),
7272
};

tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
"./components/**/*.{js,ts,jsx,tsx}",
1111
"./containers/**/*.{js,ts,jsx,tsx}",
1212
"./articles/**/*.{js,ts,jsx,tsx}",
13+
"./changelogs/**/*.{js,ts,jsx,tsx}",
1314
"./markdown/**/*.{js,ts,jsx,tsx}",
1415
"./styles/**/*.css",
1516
// OpenStatus Widget

0 commit comments

Comments
 (0)