Skip to content

Commit 6ee6c61

Browse files
authored
Remove unused blog post data content field (rescript-lang#364)
1 parent 48c55b7 commit 6ee6c61

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

src/common/BlogApi.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function getAllPosts(param) {
2626
var nonArchivedPosts = mdxFiles(postsDirectory).map(function (path) {
2727
var match = GrayMatter(Fs.readFileSync(Path.join(postsDirectory, path), "utf8"));
2828
return {
29-
content: match.content,
3029
path: path,
3130
archived: false,
3231
frontmatter: match.data
@@ -35,7 +34,6 @@ function getAllPosts(param) {
3534
var archivedPosts = mdxFiles(archivedPostsDirectory).map(function (path) {
3635
var match = GrayMatter(Fs.readFileSync(Path.join(archivedPostsDirectory, path), "utf8"));
3736
return {
38-
content: match.content,
3937
path: Path.join("archive", path),
4038
archived: true,
4139
frontmatter: match.data

src/common/BlogApi.res

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ module GrayMatter = {
3333
}
3434

3535
type postData = {
36-
content: string,
3736
path: string,
3837
archived: bool,
3938
frontmatter: Js.Json.t,
@@ -54,22 +53,20 @@ let getAllPosts = () => {
5453
}
5554

5655
let nonArchivedPosts = mdxFiles(postsDirectory)->Js.Array2.map(path => {
57-
let {GrayMatter.data: data, content} =
56+
let {GrayMatter.data: data} =
5857
Node.Path.join2(postsDirectory, path)->Node.Fs.readFileSync(#utf8)->GrayMatter.matter
5958
{
6059
path: path,
61-
content: content,
6260
frontmatter: data,
6361
archived: false,
6462
}
6563
})
6664

6765
let archivedPosts = mdxFiles(archivedPostsDirectory)->Js.Array2.map(path => {
68-
let {GrayMatter.data: data, content} =
66+
let {GrayMatter.data: data} =
6967
Node.Path.join2(archivedPostsDirectory, path)->Node.Fs.readFileSync(#utf8)->GrayMatter.matter
7068
{
7169
path: Node.Path.join2("archive", path),
72-
content: content,
7370
frontmatter: data,
7471
archived: true,
7572
}

src/common/BlogApi.resi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
type postData = {
2-
content: string,
32
path: string,
43
archived: bool,
54
frontmatter: Js.Json.t,

0 commit comments

Comments
 (0)