next 13, remove unused, update incorrect/outdated

This commit is contained in:
2023-09-20 00:25:34 -04:00
parent 797d13fd0d
commit b5ca20b93d
28 changed files with 8581 additions and 13741 deletions

View File

@@ -1,24 +1,24 @@
import Head from 'next/head';
function Meta({name, ancestors}
: {name: string, ancestors?: Array<{ name: string, path: string }> }) {
function path(): string {
if (!ancestors)
return name;
let path = '';
ancestors.forEach((obj) => {
path = `${path}${obj.name} /`;
});
return `PaulW.XYZ / ${path} ${name}`;
}
return (
<Head>
<title>{path()}</title>
</Head>
);
}
import Head from 'next/head';
function Meta({name, ancestors}
: {name: string, ancestors?: Array<{ name: string, path: string }> }) {
function path(): string {
if (!ancestors)
return name;
let path = '';
ancestors.forEach((obj) => {
path = `${path}${obj.name} /`;
});
return `PaulW.XYZ / ${path} ${name}`;
}
return (
<Head>
<title>{path()}</title>
</Head>
);
}
export default Meta;

View File

@@ -9,9 +9,7 @@ function QuickLinks() {
Object.entries(Pages).map(([title, link], i) => {
const extern = link.match(/^http/) && `blue extern` || '';
return (
<Link key={i} href={link}>
<a className={`${extern} link button`}>{title}</a>
</Link>
<Link key={i} href={link} className={`${extern} link button`}>{title}</Link>
);
})
}
@@ -19,4 +17,4 @@ function QuickLinks() {
);
}
export default QuickLinks;
export default QuickLinks;

View File

@@ -7,21 +7,17 @@ function RecentNotes({ notesMeta }: { notesMeta: INoteMeta[] }) {
<div className='h2'>Recent Notes</div>
{notesMeta?.slice(0, 10)
.map((note: any) => {
return <Link key={note.slug} href={`/notes/${note.slug}`}>
<a className={`button link`}>{note.title}</a>
</Link>
return <Link key={note.slug} href={`/notes/${note.slug}`} className={`button link`}>{note.title}</Link>
})
}
{
notesMeta.length > 10 &&
<div>
<Link href='/notes'>
<a className='h5'>More...</a>
</Link>
<Link href='/notes' className='h5'>More...</Link>
</div>
}
</div>
);
}
export default RecentNotes;
export default RecentNotes;

View File

@@ -27,13 +27,11 @@ function RecentPosts({ postsMeta }: { postsMeta: IPostMeta[] }) {
{
postsMeta.length > 10 &&
<div className={style.more}>
<Link href='/posts'>
<a className='h5'>More...</a>
</Link>
<Link href='/posts' className='h5'>More...</Link>
</div>
}
</div>
);
}
export default RecentPosts;
export default RecentPosts;

View File

@@ -1,45 +1,43 @@
import Link from 'next/link';
import style from '../styles/title.module.css';
type propsObj = {
name: string,
title?: string,
ancestors?: Array<{ name: string, path: string }>
};
function createPathElements(ancestors: Array<{ name: string, path: string }>) {
let currentPath = '';
return ancestors.map((ancestor, id) => {
currentPath += `/${ancestor.path}`
return (
<>
<Link key={id + 1} href={currentPath}>
<a>{ancestor.name}</a>
</Link>
<> / </>
</>
);
});
};
function Title({ name, title, ancestors }: propsObj) {
const pathElements = ancestors && createPathElements(ancestors) || <></>;
return (
<>
<div className={style.container}>
<h1 className={style.title}>
{title || name}
</h1>
</div>
<div className={`${style.nav} h1`}>
{name
? <><Link href='/'><a>PaulW.XYZ</a></Link> / {pathElements}{name}</>
: <>PaulW.XYZ /</>}
</div>
</>
);
}
export default Title;
import Link from 'next/link';
import style from '../styles/title.module.css';
type propsObj = {
name: string,
title?: string,
ancestors?: Array<{ name: string, path: string }>
};
function createPathElements(ancestors: Array<{ name: string, path: string }>) {
let currentPath = '';
return ancestors.map((ancestor, id) => {
currentPath += `/${ancestor.path}`
return (
<>
<Link key={id + 1} href={currentPath}>{ancestor.name}</Link>
<> / </>
</>
);
});
};
function Title({ name, title, ancestors }: propsObj) {
const pathElements = ancestors && createPathElements(ancestors) || <></>;
return (
<>
<div className={style.container}>
<h1 className={style.title}>
{title || name}
</h1>
</div>
<div className={`${style.nav} h1`}>
{name
? <><Link href='/'>PaulW.XYZ</Link> / {pathElements}{name}</>
: <>PaulW.XYZ /</>}
</div>
</>
);
}
export default Title;