优化github action 逻辑
This commit is contained in:
1 parent
7aa7e684ac
commit
05bf116c20
12 files changed
+118
-775
No files matched your search
@@ -13,7 +13,6 @@ export interface PostFrontMatter {
|
||||
tags?: string[];
|
||||
author?: string;
|
||||
layout?: string;
|
||||
ai_comment?: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
@@ -181,10 +180,6 @@ export function createPost(frontMatter: PostFrontMatter, content: string): strin
|
||||
layout: frontMatter.layout || "post",
|
||||
};
|
||||
|
||||
if (frontMatter.ai_comment) {
|
||||
fm.ai_comment = frontMatter.ai_comment;
|
||||
}
|
||||
|
||||
const fileContent = matter.stringify(content, fm);
|
||||
const indexPath = path.join(dirPath, "index.md");
|
||||
fs.writeFileSync(indexPath, fileContent, "utf-8");
|
||||
@@ -227,7 +222,6 @@ export function updatePost(
|
||||
author: merged.author || "",
|
||||
layout: merged.layout || "post",
|
||||
};
|
||||
if (merged.ai_comment) fm.ai_comment = merged.ai_comment;
|
||||
|
||||
const fileContent = matter.stringify(content ?? post.content, fm);
|
||||
fs.writeFileSync(path.join(newDirPath, "index.md"), fileContent, "utf-8");
|
||||
@@ -245,7 +239,6 @@ export function updatePost(
|
||||
author: merged.author || "",
|
||||
layout: merged.layout || "post",
|
||||
};
|
||||
if (merged.ai_comment) fm.ai_comment = merged.ai_comment;
|
||||
|
||||
const fileContent = matter.stringify(content ?? post.content, fm);
|
||||
fs.writeFileSync(post.filePath, fileContent, "utf-8");
|
||||
|
||||
Reference in new issue
Block a user