Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add markdown support to Sanity posts #8

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion app/posts/[slug]/postpage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Date from "../../../components/Layout/Date";
// }

//DO NOT PASS USER INPUT INTO MDXRemote
export default async function PostPage({
export default function PostPage({
postHead,
postData,
}: {
Expand Down
43 changes: 23 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,37 @@
"lint": "next lint"
},
"dependencies": {
"@portabletext/react": "^3.0.7",
"@portabletext/react": "^3.0.15",
"@sanity/image-url": "^1.0.2",
"@sanity/vision": "^3.16.4",
"date-fns": "^2.27.0",
"@sanity/vision": "^3.35.2",
"date-fns": "^2.30.0",
"easymde": "2",
"gray-matter": "^4.0.3",
"next": "^13.4.19",
"next": "^13.5.6",
"next-mdx-remote": "^4.4.1",
"next-sanity": "^5.4.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "^4.11.0",
"remark": "^14.0.2",
"remark-html": "^15.0.1",
"remark-parse": "^10.0.1",
"sanity": "^3.16.4",
"sass": "^1.66.1",
"next-sanity": "^5.5.11",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.12.0",
"remark": "^14.0.3",
"remark-html": "^15.0.2",
"remark-parse": "^10.0.2",
"sanity": "^3.35.2",
"sanity-plugin-markdown": "^4.1.1",
"sass": "^1.72.0",
"server-only": "^0.0.1",
"styled-components": "^6.1.8",
"suspend-react": "^0.1.3"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.0",
"@types/node": "^18.17.15",
"@types/react": "^18.2.21",
"autoprefixer": "^10.4.0",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^18.19.26",
"@types/react": "^18.2.69",
"autoprefixer": "^10.4.19",
"eslint": "7.32.0",
"eslint-config-next": "13.4.19",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.7",
"typescript": "^5.2.2"
"postcss": "^8.4.38",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.3"
}
}
1 change: 1 addition & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//import 'tailwindcss/tailwind.css'
import "../styles/globals.css";
import "easymde/dist/easymde.min.css";
import { AppProps } from "next/app";

function MyApp({ Component, pageProps }: AppProps) {
Expand Down
10 changes: 10 additions & 0 deletions pages/api/revalidate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NextRequest } from "next/server";

export async function handler(req: NextRequest) {
try{
return new Response("Hello, World!");
}catch(err){
console.error(err);
return new Response(err.message, { status: 500 });
}
}
Loading