1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 14:26:41 -04:00

separate markdown compilation to hopefully reduce function bundle sizes

This commit is contained in:
2022-06-11 11:58:23 -04:00
parent d7bc5f8ab6
commit bde473041a
5 changed files with 82 additions and 129 deletions

View File

@ -5,7 +5,8 @@ import Content from "../../components/Content";
import NoteMeta from "../../components/NoteMeta";
import Comments from "../../components/Comments";
import * as mdxComponents from "../../lib/helpers/mdx-components";
import { getNote, getNoteSlugs } from "../../lib/helpers/parse-notes";
import { getNoteSlugs } from "../../lib/helpers/parse-notes";
import { compileNote } from "../../lib/helpers/compile-note";
import * as config from "../../lib/config";
import { articleJsonLd } from "../../lib/config/seo";
import type { GetStaticProps, GetStaticPaths } from "next";
@ -74,7 +75,7 @@ const Note = ({ frontMatter, source }: Note) => {
};
export const getStaticProps: GetStaticProps = async ({ params }: { params: Pick<NoteFrontMatter, "slug"> }) => {
const { frontMatter, source } = await getNote(params.slug);
const { frontMatter, source } = await compileNote(params.slug);
return {
props: {