-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from icco/dark
Dark Mode
- Loading branch information
Showing
29 changed files
with
281 additions
and
159 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
import { defineDocumentType, makeSource } from 'contentlayer2/source-files' | ||
import remarkGfm from 'remark-gfm' | ||
import rehypeSlug from "rehype-slug" | ||
import remarkDefinitionList from 'remark-definition-list' | ||
import { defineDocumentType, makeSource } from "contentlayer2/source-files"; | ||
import rehypeSlug from "rehype-slug"; | ||
import remarkDefinitionList from "remark-definition-list"; | ||
import remarkGfm from "remark-gfm"; | ||
|
||
export const Page = defineDocumentType(() => ({ | ||
name: 'Page', | ||
name: "Page", | ||
filePathPattern: `**/*.mdx`, | ||
contentType: 'mdx', | ||
contentType: "mdx", | ||
fields: { | ||
title: { type: 'string', required: true }, | ||
title: { type: "string", required: true }, | ||
}, | ||
computedFields: { | ||
url: { | ||
type: 'string', | ||
type: "string", | ||
resolve: (doc) => { | ||
return '/wiki/' + doc._raw.flattenedPath | ||
return "/wiki/" + doc._raw.flattenedPath; | ||
}, | ||
}, | ||
pathSegments: { | ||
type: 'json', | ||
resolve: (doc) => ('/wiki/' + doc._raw.flattenedPath).split('/') | ||
type: "json", | ||
resolve: (doc) => ("/wiki/" + doc._raw.flattenedPath).split("/"), | ||
}, | ||
path: { | ||
type: 'string', | ||
type: "string", | ||
resolve: (doc) => { | ||
return doc._raw.flattenedPath | ||
return doc._raw.flattenedPath; | ||
}, | ||
}, | ||
}, | ||
})) | ||
})); | ||
|
||
export default makeSource({ | ||
contentDirPath: 'wiki', | ||
contentDirPath: "wiki", | ||
documentTypes: [Page], | ||
mdx: { | ||
remarkPlugins: [remarkGfm, remarkDefinitionList], | ||
rehypePlugins: [rehypeSlug], | ||
}, | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,12 @@ | |
"author": "Nat Welch <[email protected]>", | ||
"homepage": "https://natwelch.com", | ||
"dependencies": { | ||
"@heroicons/react": "^2.0.18", | ||
"@mdx-js/react": "^3.0.0", | ||
"@next/env": "^14.0.0", | ||
"@root/walk": "^1.1.0", | ||
"contentlayer2": "^0.5.0", | ||
"daisyui": "^4.7.3", | ||
"date-fns": "^3.0.0", | ||
"gray-matter": "^4.0.3", | ||
"isomorphic-unfetch": "^4.0.0", | ||
|
@@ -31,6 +33,7 @@ | |
"next-contentlayer2": "^0.5.0", | ||
"next-secure-headers": "^2.1.0", | ||
"next-sitemap": "^4.0.0", | ||
"next-themes": "^0.3.0", | ||
"prop-types": "^15.7.2", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ module.exports = { | |
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import "./globals.css"; | ||
|
||
import type { Metadata, Viewport } from "next"; | ||
import { Roboto, Roboto_Mono, Roboto_Slab } from "next/font/google"; | ||
|
||
import { Header, Size } from "@/components/Header"; | ||
import { ThemeProvider } from "@/components/ThemeProvider"; | ||
|
||
const roboto = Roboto({ | ||
weight: "400", | ||
variable: "--font-roboto", | ||
subsets: ["latin"], | ||
}); | ||
|
||
const robotoSlab = Roboto_Slab({ | ||
variable: "--font-roboto-slab", | ||
subsets: ["latin"], | ||
}); | ||
|
||
const robotoMono = Roboto_Mono({ | ||
subsets: ["latin"], | ||
variable: "--font-roboto-mono", | ||
display: "swap", | ||
}); | ||
|
||
export const metadata: Metadata = { | ||
title: "Nat? Nat. Nat!", | ||
description: "The personal blog of Nat Welch", | ||
other: { | ||
webmention: "https://webmention.io/natwelch.com/webmention", | ||
pingback: "https://webmention.io/natwelch.com/xmlrpc", | ||
charset: "utf-8", | ||
}, | ||
}; | ||
|
||
export const viewport: Viewport = { | ||
viewportFit: "cover", | ||
initialScale: 1.0, | ||
width: "device-width", | ||
}; | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<html | ||
lang="en" | ||
className={`${roboto.variable} ${robotoSlab.variable} ${robotoMono.variable}`} | ||
suppressHydrationWarning | ||
> | ||
<body> | ||
<ThemeProvider defaultTheme="system" enableSystem> | ||
<Header size={Size.Small} /> | ||
<main>{children}</main> | ||
</ThemeProvider> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.