diff --git a/pages/api/hello.ts b/pages/api/hello.ts deleted file mode 100644 index e963280..0000000 --- a/pages/api/hello.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction - -export default (req, res) => { - res.status(200).json({ name: "John Doe" }); -}; diff --git a/pages/posts/[slug].tsx b/pages/posts/[slug].tsx index 81dfcbb..154454c 100644 --- a/pages/posts/[slug].tsx +++ b/pages/posts/[slug].tsx @@ -2,9 +2,9 @@ import fs from "fs"; import matter from "gray-matter"; import hydrate from "next-mdx-remote/hydrate"; import renderToString from "next-mdx-remote/render-to-string"; -import Link from "next/link"; import path from "path"; import { postFilePaths, POSTS_PATH } from "../../utils/mdxUtils"; +import styles from "../../styles/Post.module.css"; // Custom components/renderers to pass to MDX. // Since the MDX files aren't loaded by webpack, they have no knowledge of how @@ -17,17 +17,10 @@ const components = { export default function PostPage({ source, frontMatter }) { const content = hydrate(source, { components }); return ( -
-
- -
-
+
+

{frontMatter.title}

- {frontMatter.description &&

{frontMatter.description}

} +

{frontMatter.description}

{content}
diff --git a/styles/Post.module.css b/styles/Post.module.css new file mode 100644 index 0000000..af5cc34 --- /dev/null +++ b/styles/Post.module.css @@ -0,0 +1,42 @@ +.post { + line-height: 30px; +} + +.post .info { + margin: 4rem 0 4rem 0; +} + +.post .info h1 { + color: var(--light-text); + font-size: 30px; + font-weight: 700; + margin-bottom: 10px; +} + +.post .info p { + color: var(--darker-text); + font-size: 25px; +} + +.post main h2 { + color: var(--light-text); + margin-bottom: 1rem; +} + +.post main p { + color: var(--darker-text); + font-size: 20px; + margin-bottom: 1.25rem; +} + +.post main a { + color: var(--primary-accent-colour); +} + +.post main a:hover { + text-decoration: underline; +} + +.post main ul { + color: var(--light-text); +}