1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-17 18:45:32 -04:00

pre-render optimizations

This commit is contained in:
2025-03-14 12:51:18 -04:00
parent e162d6a46c
commit 3932660acc
57 changed files with 305 additions and 318 deletions

View File

@@ -3,10 +3,7 @@ import glob from "fast-glob";
import pMap from "p-map";
import pMemoize from "p-memoize";
import { formatDate } from "./format-date";
import config from "../config";
// path to directory with .mdx files, relative to project root
const POSTS_DIR = "notes";
import { BASE_URL, POSTS_DIR } from "../config/constants";
export type FrontMatter = {
slug: string;
@@ -65,7 +62,7 @@ export const getFrontMatter = async (slug: string): Promise<FrontMatter> => {
htmlTitle,
slug,
date: formatDate(frontmatter.date), // validate/normalize the date string provided from front matter
permalink: `${config.baseUrl}/${POSTS_DIR}/${slug}`,
permalink: `${BASE_URL}/${POSTS_DIR}/${slug}`,
};
};