Skip to content

Commit

Permalink
test new version
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronoff97 committed Dec 19, 2023
1 parent ef98523 commit 24018e4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
14 changes: 7 additions & 7 deletions app/archive/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { MDXRemote } from "next-mdx-remote/rsc";
import { getPostBySlug, getArchivedPosts } from "../../../lib/api";

export function generateStaticParams() {
const posts = getArchivedPosts(["slug", "date"]);
return posts.map((post) => ({
slug: encodeURI(post.slug),
}));
}

export default async function Page({ params }: { params: { slug: string } }) {
const post = getPostBySlug(params.slug, ["title", "author", "content"]);

Expand All @@ -17,10 +24,3 @@ export default async function Page({ params }: { params: { slug: string } }) {
</div>
);
}

export async function generateStaticParams() {
const posts = getArchivedPosts(["slug", "date"]);
return posts.map((post) => ({
slug: encodeURI(post.slug),
}));
}
14 changes: 7 additions & 7 deletions app/posts/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { MDXRemote } from "next-mdx-remote/rsc";
import { getPostBySlug, getAllPosts } from "../../../lib/api";

export function generateStaticParams() {
const posts = getAllPosts(["slug", "date"]);
return posts.map((post) => ({
slug: encodeURI(post.slug),
}));
}

export default async function Page({ params }: { params: { slug: string } }) {
const post = getPostBySlug(params.slug, ["title", "author", "content"]);

Expand All @@ -16,10 +23,3 @@ export default async function Page({ params }: { params: { slug: string } }) {
</div>
);
}

export async function generateStaticParams() {
const posts = getAllPosts(["slug", "date"]);
return posts.map((post) => ({
slug: encodeURI(post.slug),
}));
}
Binary file modified bun.lockb
Binary file not shown.
5 changes: 2 additions & 3 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

import Link from "next/link";

export default function Navbar() {
return (
<div>
<nav className="container py-2 mx-auto">
<ul className="flex space-x-6 text-lg justify-center">
<nav className="container mx-auto py-2">
<ul className="flex justify-center space-x-6 text-lg">
<li>
<NavLink href="/">Home</NavLink>
</li>
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const withMDX = require("@next/mdx")();

/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export",
// output: "export",
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
// Optionally, add any other Next.js config below
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/mdx": "^2.0.10",
"date-fns": "^2.30.0",
"gray-matter": "^4.0.3",
"next": "13.4.19",
"next": "14.0.4",
"next-mdx-remote": "^4.4.1",
"react": "^18",
"react-dom": "^18",
Expand Down

0 comments on commit 24018e4

Please sign in to comment.