summary refs log tree commit diff
path: root/lib/getPost.ts
blob: 6e90b1f3d7e0208aa65097886cd7391f9070607a (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;
}