Skip to content

Commit

Permalink
chore: テンプレートファイル編集
Browse files Browse the repository at this point in the history
  • Loading branch information
yossydev committed Oct 14, 2024
1 parent e948f99 commit 903f775
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/libs/posts/generate-post.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ function generatePost() {
const updatedData = data
.replace(/{{title}}/g, title) // 文書全体のタイトルプレースホルダを置き換え
.replace(/{{description}}/g, description)
.replace(/{{date}}/g, currentDate);
.replace(/{{date}}/g, currentDate)
.replace(/{{filePath}}/g, filePath);

writeFile(filePath, updatedData, (err) => {
if (err) {
Expand Down
2 changes: 2 additions & 0 deletions app/libs/posts/template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: "{{title}}"
description: "{{description}}"
date: "{{date}}"
updatedAt: "{{date}}"
path: "{{filename}}"
published: true
---

Expand Down

0 comments on commit 903f775

Please sign in to comment.