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

dayjs ➡️ date-fns

This commit is contained in:
2025-03-21 13:20:42 -04:00
parent 9fd3de8569
commit 8890c1d08d
9 changed files with 57 additions and 60 deletions

View File

@@ -4,7 +4,6 @@ import glob from "fast-glob";
import { unified } from "unified";
import { remarkHtml, remarkParse, remarkSmartypants } from "./remark-rehype-plugins";
import { decode } from "html-entities";
import { formatDate } from "./format-date";
import { BASE_URL, POSTS_DIR } from "../config/constants";
export type FrontMatter = {
@@ -48,7 +47,7 @@ export const getFrontMatter = async (slug: string): Promise<FrontMatter> => {
// stylized title with limited html tags:
htmlTitle,
slug,
date: formatDate(frontmatter.date), // validate/normalize the date string provided from front matter
date: new Date(frontmatter.date).toISOString(), // validate/normalize the date string provided from front matter
permalink: `${BASE_URL}/${POSTS_DIR}/${slug}`,
};
};