1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-01-11 03:02:56 -05:00

consistent use of arrow functions/default exports

This commit is contained in:
2022-01-02 15:16:07 -05:00
parent cd5a1b191a
commit ca614e1a1a
34 changed files with 2956 additions and 2985 deletions

View File

@@ -19,54 +19,52 @@ import rehypeExternalLinks from "rehype-external-links";
import rehypeSlug from "rehype-slug";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
export default function Page({ source, frontMatter, slug }) {
return (
<>
<NextSeo
title={frontMatter.title}
description={frontMatter.description}
openGraph={{
title: frontMatter.title,
type: "article",
article: {
publishedTime: frontMatter.date,
const Note = ({ source, frontMatter, slug }) => (
<>
<NextSeo
title={frontMatter.title}
description={frontMatter.description}
openGraph={{
title: frontMatter.title,
type: "article",
article: {
publishedTime: frontMatter.date,
},
images: [
{
url: `${config.baseURL}${frontMatter.image}`,
alt: frontMatter.title,
},
images: [
{
url: `${config.baseURL}${frontMatter.image}`,
alt: frontMatter.title,
},
],
}}
twitter={{
handle: `@${config.twitterHandle}`,
site: `@${config.twitterHandle}`,
cardType: "summary_large_image",
}}
/>
<ArticleJsonLd
url={`${config.baseURL}/notes/${slug}`}
title={frontMatter.title}
description={frontMatter.description}
datePublished={frontMatter.date}
dateModified={frontMatter.date}
images={[`${config.baseURL}${frontMatter.image}`]}
authorName={[config.authorName]}
publisherName={config.siteName}
publisherLogo={`${config.baseURL}/static/images/me.jpg`}
/>
],
}}
twitter={{
handle: `@${config.twitterHandle}`,
site: `@${config.twitterHandle}`,
cardType: "summary_large_image",
}}
/>
<ArticleJsonLd
url={`${config.baseURL}/notes/${slug}`}
title={frontMatter.title}
description={frontMatter.description}
datePublished={frontMatter.date}
dateModified={frontMatter.date}
images={[`${config.baseURL}${frontMatter.image}`]}
authorName={[config.authorName]}
publisherName={config.siteName}
publisherLogo={`${config.baseURL}/static/images/me.jpg`}
/>
<Layout>
<Container>
<Meta {...frontMatter} slug={slug} />
<Content>
<MDXRemote {...source} components={mdxComponents} />
</Content>
</Container>
</Layout>
</>
);
}
<Layout>
<Container>
<Meta {...frontMatter} slug={slug} />
<Content>
<MDXRemote {...source} components={mdxComponents} />
</Content>
</Container>
</Layout>
</>
);
export const getStaticProps: GetStaticProps = async ({ params }) => {
const filePath = path.join(NOTES_PATH, `${params.slug}.mdx`);
@@ -111,3 +109,5 @@ export const getStaticPaths: GetStaticPaths = async () => {
fallback: false,
};
};
export default Note;

View File

@@ -6,17 +6,13 @@ import List from "../../components/notes/List";
import { getAllNotes } from "../../lib/parse-notes";
import type { GetStaticProps } from "next";
export default function Notes({ notesByYear }) {
return (
<>
<Layout>
<Container title="Notes" description="Recent posts by Jake Jarvis.">
<List notesByYear={notesByYear} />
</Container>
</Layout>
</>
);
}
const Notes = ({ notesByYear }) => (
<Layout>
<Container title="Notes" description="Recent posts by Jake Jarvis.">
<List notesByYear={notesByYear} />
</Container>
</Layout>
);
export const getStaticProps: GetStaticProps = async () => {
const allNotes = getAllNotes(["date", "slug", "title"]);
@@ -30,3 +26,5 @@ export const getStaticProps: GetStaticProps = async () => {
},
};
};
export default Notes;