Skip to content

Commit

Permalink
Add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
255kb committed Nov 17, 2023
1 parent 012b537 commit 87565cc
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 372 deletions.
4 changes: 2 additions & 2 deletions components/code-block.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FunctionComponent } from 'react';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism';
import { nord } from 'react-syntax-highlighter/dist/cjs/styles/prism';

const CodeBlock: FunctionComponent<{
code: string;
Expand All @@ -12,7 +12,7 @@ const CodeBlock: FunctionComponent<{
const optionalProps: { style?: any } = {};

if (dark) {
optionalProps.style = vscDarkPlus;
optionalProps.style = nord;
}

return (
Expand Down
33 changes: 26 additions & 7 deletions components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const heading = (props) => {
<>
{children}
<a
id={linkSlug}
href={`#${linkSlug}`}
className='ms-2 fs-3 fw-bold text-muted text-decoration-none'
>
Expand All @@ -39,17 +38,37 @@ const heading = (props) => {
);
switch (props.node.tagName) {
case 'h1':
return <h1>{container(props.children)}</h1>;
return <h1 id={linkSlug}>{container(props.children)}</h1>;
case 'h2':
return <h2 className='mt-8'>{container(props.children)}</h2>;
return (
<h2 id={linkSlug} className='mt-8'>
{container(props.children)}
</h2>
);
case 'h3':
return <h3 className='mt-6'>{container(props.children)}</h3>;
return (
<h3 id={linkSlug} className='mt-6'>
{container(props.children)}
</h3>
);
case 'h4':
return <h4 className='mt-6'>{container(props.children)}</h4>;
return (
<h4 id={linkSlug} className='mt-6'>
{container(props.children)}
</h4>
);
case 'h5':
return <h5 className='mt-4'>{container(props.children)}</h5>;
return (
<h5 id={linkSlug} className='mt-4'>
{container(props.children)}
</h5>
);
case 'h6':
return <h6 className='mt-4'>{container(props.children)}</h6>;
return (
<h6 id={linkSlug} className='mt-4'>
{container(props.children)}
</h6>
);
}
};

Expand Down
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MyDocument extends Document {
<Head>
<link
rel='preload'
href='/fonts/mockoon.ttf?fqkf57'
href='/fonts/mockoon.woff?eompgf'
as='font'
crossOrigin=''
/>
Expand Down
Binary file not shown.
Loading

0 comments on commit 87565cc

Please sign in to comment.