Skip to content

Commit

Permalink
fix front-matter
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Oct 27, 2023
1 parent 30536c3 commit b3e54c6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/hexo/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ class Post {
// Read the content
src = join(draftDir, item);
return readFile(src);
}).then(content => {
}).then((content: string) => {
// Create post
Object.assign(data, yfmParse(content));
data.content = data._content;
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/processor/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function processPage(ctx: Hexo, file: _File) {
return Promise.all([
file.stat(),
file.read()
]).spread((stats: Stats, content: string | Buffer) => {
]).spread((stats: Stats, content: string) => {
const data = yfm(content);
const output = ctx.render.getOutput(path);

Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/processor/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function processPost(ctx: Hexo, file: _File) {
return Promise.all([
file.stat(),
file.read()
]).spread((stats: Stats, content: string | Buffer) => {
]).spread((stats: Stats, content: string) => {
const data = yfm(content);
const info = parseFilename(config.new_post_name, path);
const keys = Object.keys(info);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@
"warehouse": "^5.0.0"
},
"devDependencies": {
"0x": "^5.1.2",
"@types/bluebird": "^3.5.37",
"@types/node": "^18.11.8",
"@types/nunjucks": "^3.2.2",
"@types/text-table": "^0.2.4",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"0x": "^5.1.2",
"c8": "^8.0.0",
"chai": "^4.3.6",
"cheerio": "0.22.0",
Expand Down

0 comments on commit b3e54c6

Please sign in to comment.