blob: 4860ff975fabcb2cb4cb997aec8d7ee6e31e99e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import Post from "./Post";
interface getPostArgument {
year: string;
month: string;
day: string;
title: string;
}
export function getPost(
{ year, month, day, title }: getPostArgument,
path: string
): Post {
const filePath = `${path}/${year}/${month}/${day}/${title}.md`;
const post = new Post(filePath);
return post;
}
|