jaredly / jaredly/hexo-admin

Add JSON front-matter support

Open
#64 1 comment 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
JavaScript
Stars
1.8k
Forks
299
PR merge metrics
No merged PRs in 30d

Description

my hexo JSON Front-matter as follows:

```
;;;
"title": "我的VIM配置",
"categories": "工具",
"tags": ["linux", "vim"]
;;;

```

and i select this markdown file to edit, error came out:

```
YAMLException: end of the stream or a document separator is expected at line 1, column 19:
"title": "我的VIM配置",
^
at generateError (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:162:10)
at throwError (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:168:9)
at readDocument (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:1508:5)
at loadDocuments (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:1544:5)
at Object.load (/Users/jeremy/dev/git/blog/node_modules/js-yaml/lib/js-yaml/loader.js:1561:19)
at parseYAML (/Users/jeremy/dev/git/blog/node_modules/hexo-front-matter/lib/front_matter.js:80:21)
at Function.parse (/Users/jeremy/dev/git/blog/node_modules/hexo-front-matter/lib/front_matter.js:56:12)
at module.exports (/Users/jeremy/dev/git/blog/node_modules/hexo-admin/update.js:31:20)
at /Users/jeremy/dev/git/blog/node_modules/hexo-admin/api.js:221:5
at /Users/jeremy/dev/git/blog/node_modules/hexo-admin/api.js:91:7
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the update path named in the trace, hexo-admin/update.js, and follow how it calls hexo-front-matter to parse the selected Markdown file. Check how the existing YAML front matter is handled, then verify that the shown JSON front matter can be edited without the YAMLException.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, json
Domain
content
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.