Skip to content

Commit

Permalink
update blog-starter to App Router
Browse files Browse the repository at this point in the history
  • Loading branch information
zeevo committed Jan 26, 2024
1 parent 0cdc927 commit 05c9389
Show file tree
Hide file tree
Showing 56 changed files with 332 additions and 365 deletions.
1 change: 0 additions & 1 deletion examples/blog-starter/@types/remark-html.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion examples/blog-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is the existing [blog-starter](https://github.com/vercel/next.js/tree/canary/examples/blog-starter) plus TypeScript.

This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using Markdown files as the data source.
This example showcases Next.js's [Static Generation](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts) feature using Markdown files as the data source.

The blog posts are stored in `/_posts` as Markdown files with front matter support. Adding a new Markdown file in there will create a new blog post.

Expand Down
23 changes: 0 additions & 23 deletions examples/blog-starter/components/layout.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions examples/blog-starter/components/meta.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions examples/blog-starter/components/section-separator.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions examples/blog-starter/interfaces/author.ts

This file was deleted.

4 changes: 4 additions & 0 deletions examples/blog-starter/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
36 changes: 20 additions & 16 deletions examples/blog-starter/package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
{
"name": "blog-starter",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next",
"dev": "next dev",
"build": "next build",
"start": "next start",
"typecheck": "tsc"
"lint": "next lint"
},
"dependencies": {
"classnames": "^2.3.1",
"date-fns": "^2.28.0",
"classnames": "^2.5.1",
"date-fns": "^3.3.1",
"gray-matter": "^4.0.3",
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remark": "^14.0.2",
"remark-html": "^15.0.1",
"typescript": "^4.7.4"
"next": "14.1.0",
"react": "^18",
"react-dom": "^18",
"remark": "^15.0.1",
"remark-html": "^16.0.1"
},
"devDependencies": {
"@types/node": "^18.0.3",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"autoprefixer": "^10.4.7",
"postcss": "^8.4.14",
"tailwindcss": "^3.1.4"
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
}
6 changes: 0 additions & 6 deletions examples/blog-starter/pages/_app.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions examples/blog-starter/pages/_document.tsx

This file was deleted.

56 changes: 0 additions & 56 deletions examples/blog-starter/pages/index.tsx

This file was deleted.

96 changes: 0 additions & 96 deletions examples/blog-starter/pages/posts/[slug].tsx

This file was deleted.

2 changes: 0 additions & 2 deletions examples/blog-starter/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// If you want to use other PostCSS plugins, see the following:
// https://tailwindcss.com/docs/using-with-preprocessors
module.exports = {
plugins: {
tailwindcss: {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Container from "./container";
import Container from "@/app/_components/container";
import { EXAMPLE_PATH } from "@/lib/constants";
import cn from "classnames";
import { EXAMPLE_PATH } from "../lib/constants";

type Props = {
preview?: boolean;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Container from "./container";
import { EXAMPLE_PATH } from "../lib/constants";
import Container from "@/app/_components/container";
import { EXAMPLE_PATH } from "@/lib/constants";

const Footer = () => {
export function Footer() {
return (
<footer className="bg-neutral-50 border-t border-neutral-200">
<Container>
Expand All @@ -11,7 +11,7 @@ const Footer = () => {
</h3>
<div className="flex flex-col lg:flex-row justify-center items-center lg:pl-4 lg:w-1/2">
<a
href="https://nextjs.org/docs/basic-features/pages"
href="https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts"
className="mx-3 bg-black hover:bg-white hover:text-black border border-black text-white font-bold py-3 px-12 lg:px-8 duration-200 transition-colors mb-6 lg:mb-0"
>
Read Documentation
Expand All @@ -27,6 +27,6 @@ const Footer = () => {
</Container>
</footer>
);
};
}

export default Footer;
File renamed without changes.
Loading

0 comments on commit 05c9389

Please sign in to comment.