next 13, remove unused, update incorrect/outdated
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
import Link from 'next/link';
|
||||
import Layout from '../components/layout';
|
||||
|
||||
function NotFoundPage() {
|
||||
return (
|
||||
<Layout title='Page Not Found' name='... ??? / 404: Not Found'>
|
||||
<section className='block text center'>
|
||||
<h1>Error 404</h1>
|
||||
<p>
|
||||
<strong>Uh oh! The page you are looking for does not exist...</strong><br />
|
||||
</p>
|
||||
<Link href='/'>
|
||||
<a className='button green back link'>
|
||||
Go Home
|
||||
</a>
|
||||
</Link>
|
||||
<a className='button blue link extern' href='https://en.wikipedia.org/wiki/List_of_HTTP_status_codes'>
|
||||
More on HTTP status codes
|
||||
</a>
|
||||
</section>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default NotFoundPage;
|
||||
import Link from 'next/link';
|
||||
import Layout from '../components/layout';
|
||||
|
||||
function NotFoundPage() {
|
||||
return (
|
||||
<Layout title='Page Not Found' name='... ??? / 404: Not Found'>
|
||||
<section className='block text center'>
|
||||
<h1>Error 404</h1>
|
||||
<p>
|
||||
<strong>Uh oh! The page you are looking for does not exist...</strong><br />
|
||||
</p>
|
||||
<Link href='/' className='button green back link'>Go Home</Link>
|
||||
<a className='button blue link extern' href='https://en.wikipedia.org/wiki/List_of_HTTP_status_codes'>
|
||||
More on HTTP status codes
|
||||
</a>
|
||||
</section>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default NotFoundPage;
|
||||
|
||||
@@ -7,14 +7,12 @@ import RecentPosts from '../components/recent-posts';
|
||||
import { getNotesMeta, getPostsMeta, INoteMeta, IPostMeta } from '../lib/slug';
|
||||
|
||||
function Nav() {
|
||||
const nav = {'Posts': '/posts', 'Notes': '/notes', 'About': '/about', };
|
||||
const nav = { 'Posts': '/posts', 'Notes': '/notes', 'About': '/about', };
|
||||
return (
|
||||
<div className='block' style={{textAlign: 'center'}}>
|
||||
<div className='block' style={{ textAlign: 'center' }}>
|
||||
{
|
||||
Object.entries(nav).map(([k, v], i) => {
|
||||
return <Link key={i} href={v}>
|
||||
<a className='button green'>{k}</a>
|
||||
</Link>
|
||||
return <Link key={i} href={v} className='button green'>{k}</Link>
|
||||
})
|
||||
}
|
||||
</div>
|
||||
@@ -38,4 +36,4 @@ export async function getStaticProps() {
|
||||
};
|
||||
}
|
||||
|
||||
export default HomePage;
|
||||
export default HomePage;
|
||||
|
||||
@@ -6,35 +6,39 @@ import { monokaiSublime as hlTheme } from 'react-syntax-highlighter/dist/cjs/sty
|
||||
import remarkGfm from 'remark-gfm';
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
|
||||
function Markdown({content}: any) {
|
||||
return <ReactMarkdown
|
||||
remarkPlugins={[remarkGfm]}
|
||||
rehypePlugins={[rehypeRaw]}
|
||||
components={{
|
||||
code({ node, inline, className, children, ...props }) {
|
||||
const match = /language-(\w+)/.exec(className || '')
|
||||
return !inline && match
|
||||
? (
|
||||
<SyntaxHighlighter
|
||||
showLineNumbers={true}
|
||||
language={match[1]}
|
||||
//@ts-ignore
|
||||
style={hlTheme}
|
||||
PreTag='div'
|
||||
codeTagProps={{ style: { display: 'block' } }}
|
||||
customStyle={{ padding: '0', borderRadius: '1rem' }}
|
||||
{...props}
|
||||
>{String(children).replace(/\n$/, '')}</SyntaxHighlighter>
|
||||
)
|
||||
: <code className={className} {...props}>
|
||||
{children}
|
||||
</code>
|
||||
}
|
||||
}}
|
||||
>{content}</ReactMarkdown>
|
||||
}
|
||||
|
||||
function Note({ note }: any) {
|
||||
return (<>
|
||||
<Layout name={note.title} title={note.title} ancestors={[{ name: 'Notes', path: 'notes' }]}>
|
||||
<section className='block'>
|
||||
<ReactMarkdown
|
||||
remarkPlugins={[remarkGfm]}
|
||||
rehypePlugins={[rehypeRaw]}
|
||||
components={{
|
||||
code({ node, inline, className, children, ...props }) {
|
||||
const match = /language-(\w+)/.exec(className || '')
|
||||
return !inline && match
|
||||
? (
|
||||
<SyntaxHighlighter
|
||||
showLineNumbers={true}
|
||||
language={match[1]}
|
||||
//@ts-ignore
|
||||
style={hlTheme}
|
||||
PreTag='div'
|
||||
codeTagProps={{ style: { display: 'block' } }}
|
||||
customStyle={{ padding: '0', borderRadius: '1rem' }}
|
||||
{...props}
|
||||
>{String(children).replace(/\n$/, '')}</SyntaxHighlighter>
|
||||
)
|
||||
: <code className={className} {...props}>
|
||||
{children}
|
||||
</code>
|
||||
}
|
||||
}}
|
||||
>{note.content}</ReactMarkdown>
|
||||
<Markdown content={note.content} />
|
||||
</section>
|
||||
</Layout>
|
||||
</>
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
import Layout from '../components/layout';
|
||||
import { mapChild, toListItem } from '../components/lists';
|
||||
import pl from '../public/playlists.yaml';
|
||||
|
||||
function Playlists() {
|
||||
|
||||
return (
|
||||
<Layout name='Playlists'>
|
||||
<h2>Music</h2>
|
||||
{
|
||||
pl.map((item: Record<string, any>) => {
|
||||
const lItem = toListItem(item)
|
||||
if (lItem)
|
||||
return mapChild(lItem, 0, {
|
||||
'spotify': (i) => {
|
||||
return <div>
|
||||
<a className='extern link button'
|
||||
href={`https://open.spotify.com/track/${i.id}`}></a>
|
||||
{i.title}</div>;
|
||||
},
|
||||
'youtube-playlist': (i) => {
|
||||
return <div>
|
||||
<a className='extern link button'
|
||||
href={`https://youtube.com/playlist?list=${i.id}`}></a>
|
||||
{i.title}</div>;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
export default Playlists;
|
||||
@@ -22,16 +22,14 @@ function PostsPage({ postsMeta }: { postsMeta: IPostMeta[] }) {
|
||||
flex: '1 1 60%',
|
||||
alignItems: 'center',
|
||||
fontFamily: `'EB Garamond', 'Garamond', 'Times New Roman', Times, serif`}}>
|
||||
<Link href={`/posts/${post.slug}`} >
|
||||
<a style={{textDecoration: 'none'}}>{post.title}</a>
|
||||
</Link>
|
||||
<Link href={`/posts/${post.slug}`} style={{textDecoration: 'none'}}>{post.title}</Link>
|
||||
</td>
|
||||
</tr>
|
||||
}) ||
|
||||
<div className='text center'>
|
||||
<div>**crickets**</div>
|
||||
<div>No posts found...</div>
|
||||
<div><Link href='/'><a className='link button green back'>Go Home</a></Link></div>
|
||||
<div><Link href='/' className='link button green back'>Go Home</Link></div>
|
||||
</div>
|
||||
}
|
||||
</tbody>
|
||||
@@ -46,4 +44,4 @@ export async function getStaticProps() {
|
||||
};
|
||||
}
|
||||
|
||||
export default PostsPage;
|
||||
export default PostsPage;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import Layout from '../components/layout';
|
||||
import rec from '../public/recommended.yaml';
|
||||
import { toListItem, mapChild } from '../components/lists';
|
||||
|
||||
function Recommended() {
|
||||
return (
|
||||
<Layout name='Recommended' title='My Recommendations'>
|
||||
<section className='block'>
|
||||
<p>This page is really for me to not forget/revisit the good things I have read, seen, heard, and/or experienced. This list may change, just as my opinions.</p>
|
||||
<p>If the one you are looking for is not on this list, it is most likely I have not had the chance to read/listen to/watch it yet.</p>
|
||||
</section>
|
||||
{
|
||||
rec.map((item: Record<string, any>) => {
|
||||
const lItem = toListItem(item)
|
||||
if (lItem)
|
||||
return mapChild(lItem, 0)
|
||||
})
|
||||
}
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Recommended;
|
||||
@@ -1,18 +0,0 @@
|
||||
import Layout from '../components/layout';
|
||||
import res from '../public/resources.yaml';
|
||||
import { toListItem, mapChild } from '../components/lists';
|
||||
|
||||
function Resources() {
|
||||
return (
|
||||
<Layout name='Resources' title='Some Useful Resources'>
|
||||
{
|
||||
res.map((item: Record<string, any>) => {
|
||||
const lItem = toListItem(item)
|
||||
if (lItem)
|
||||
return mapChild(lItem, 0)
|
||||
})
|
||||
}
|
||||
</Layout>);
|
||||
}
|
||||
|
||||
export default Resources;
|
||||
Reference in New Issue
Block a user