Add new notes, fix minor issues

This commit is contained in:
2024-10-02 22:47:34 -04:00
parent 6e9a488e5b
commit 910f531207
10 changed files with 121 additions and 9 deletions

View File

@@ -1,10 +1,12 @@
import Layout from '../../components/layout';
import ReactMarkdown from 'react-markdown';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { monokaiSublime as hlTheme } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import remarkGfm from 'remark-gfm';
import rehypeRaw from 'rehype-raw';
import remarkDirective from 'remark-directive';
import remarkGithubAdmonitionsToDirectives from 'remark-github-admonitions-to-directives';
import Layout from '../../components/layout';
import readMarkdown from '../../lib/read-markdown';
import NotesInfo from '../../public/notes.json';
@@ -19,7 +21,7 @@ interface Notes {
function Markdown({ content }: any) {
return <ReactMarkdown
remarkPlugins={[remarkGfm]}
remarkPlugins={[remarkGithubAdmonitionsToDirectives, remarkDirective]}
rehypePlugins={[rehypeRaw]}
components={{
code({ node, className, children, ...props }) {

View File

@@ -8,14 +8,14 @@ function traverseMap(head: Site, cwd = '', depth = 0) {
return [];
let elements = [];
for (const [slug, info] of Object.entries(head.subpages)) {
if (slug === 'sitemap')
continue;
const path = `${cwd}/${slug}`;
const children = (<><dl style={{marginLeft: '3rem'}}> {traverseMap(info, path, depth + 1)}</dl></>);
elements.push(<>
<>
<dt>{info.title}</dt>
<dd><Link href={path}>{path}</Link></dd>
<dd><Link href={path}>paulw.xyz{path}</Link></dd>
{children}
</>
</>);
}
return elements;