refactor: rename published to date
This commit is contained in:
parent
a95232e1b0
commit
1057d40d78
@ -49,10 +49,10 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
|
|||||||
export default function Post() {
|
export default function Post() {
|
||||||
const {
|
const {
|
||||||
code,
|
code,
|
||||||
frontmatter: { title, published },
|
frontmatter: { title, date },
|
||||||
file,
|
file,
|
||||||
} = useLoaderData<typeof loader>();
|
} = useLoaderData<typeof loader>();
|
||||||
const formattedDate = useFormattedDate(published);
|
const formattedDate = useFormattedDate(date);
|
||||||
const MdxComponent = React.useMemo(() => getMDXComponent(code), [code]);
|
const MdxComponent = React.useMemo(() => getMDXComponent(code), [code]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { remarkCodeHike } from "@code-hike/mdx";
|
import { remarkCodeHike } from "@code-hike/mdx";
|
||||||
import { bundleMDX } from "mdx-bundler";
|
import { bundleMDX } from "mdx-bundler";
|
||||||
import { readdir, readFile } from "node:fs/promises";
|
import { readFile, readdir } from "node:fs/promises";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
type FrontMatter = {
|
type FrontMatter = {
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
published: Date;
|
date: Date;
|
||||||
isFeatured: boolean;
|
isFeatured: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ export const findPosts = async () => {
|
|||||||
posts.push({
|
posts.push({
|
||||||
...frontmatter,
|
...frontmatter,
|
||||||
filename: file.replace(".mdx", ""),
|
filename: file.replace(".mdx", ""),
|
||||||
published: frontmatter.published.toISOString(),
|
published: frontmatter.date.toISOString(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Hello, world
|
title: Hello, world
|
||||||
published: 2023-03-15
|
date: 2023-03-15
|
||||||
description: The hello world post
|
description: The hello world post
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: How this site is built
|
title: How this site is built
|
||||||
published: 2024-09-29
|
date: 2024-09-29
|
||||||
description: A technical explanation of how this site works
|
description: A technical explanation of how this site works
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Run Shopify App without the App Bridge
|
title: Run Shopify App without the App Bridge
|
||||||
published: 2024-10-07
|
date: 2024-10-07
|
||||||
description: Let's get rid of Shopify's app bridge.
|
description: Let's get rid of Shopify's app bridge.
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user