Fix markdown library incompatibility; fix 404

Signed-off-by: Paul W. <lambdapaul@protonmail.com>
This commit is contained in:
Paul W. 2023-10-30 00:55:45 -04:00
parent 35d56f5cde
commit d3591c4db6
No known key found for this signature in database
GPG Key ID: 0023B93C0FF1E1D4
4 changed files with 35 additions and 21 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -12,10 +12,10 @@
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-markdown": "^8.0.7", "react-markdown": "^9.0.0",
"react-syntax-highlighter": "^15.5.0", "react-syntax-highlighter": "^15.5.0",
"rehype-raw": "^6.1.1", "rehype-raw": "^7.0.0",
"remark-gfm": "^3.0.1", "remark-gfm": "^4.0.0",
"uri-js": "^4.4.1" "uri-js": "^4.4.1"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,23 @@
import Head from 'next/head';
import Link from 'next/link'; import Link from 'next/link';
import Layout from '../components/layout';
import style from '../styles/title.module.css';
function NotFoundPage() { function NotFoundPage() {
// clean this page up
return ( return (
<Layout <>
// title='Page Not Found' name='... ??? / 404: Not Found' <Head>
> <title>404: Not Found | PaulW.XYZ</title>
</Head>
<div className={style.container}>
<h1 className={style.title}>
Page Not Found
</h1>
</div>
<div className={`${style.nav} h1`}>
<Link href='/'>PaulW.XYZ</Link> / ... ??? / 404: Not Found </div>
<div className='container'>
<section className='block text center'> <section className='block text center'>
<h1>Error 404</h1> <h1>Error 404</h1>
<p> <p>
@ -16,7 +28,9 @@ function NotFoundPage() {
More on HTTP status codes More on HTTP status codes
</a> </a>
</section> </section>
</Layout> </div>
</>
); );
} }

View File

@ -4,8 +4,8 @@ import SyntaxHighlighter from 'react-syntax-highlighter';
import { monokaiSublime as hlTheme } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; import { monokaiSublime as hlTheme } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import remarkGfm from 'remark-gfm'; import remarkGfm from 'remark-gfm';
import rehypeRaw from 'rehype-raw'; import rehypeRaw from 'rehype-raw';
import readMarkdown from '../../lib/read-markdown';
import readMarkdown from '../../lib/read-markdown';
import NotesInfo from '../../public/notes.json'; import NotesInfo from '../../public/notes.json';
interface Note { interface Note {
@ -22,9 +22,9 @@ function Markdown({ content }: any) {
remarkPlugins={[remarkGfm]} remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeRaw]} rehypePlugins={[rehypeRaw]}
components={{ components={{
code({ node, inline, className, children, ...props }) { code({ node, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || '') const match = /language-(\w+)/.exec(className || '')
return !inline && match return match
? ( ? (
<SyntaxHighlighter <SyntaxHighlighter
showLineNumbers={true} showLineNumbers={true}