Skip to content

Commit 57098d5

Browse files
committed
fix(index.js): 解决解析warn
1 parent 202e34b commit 57098d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webhook/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function getContent(filename, data) {
8686
*/
8787
function updateContent(modified, removed) {
8888
const file = String(fs.readFileSync(`${articlePath}/mkdocs.yml`));
89-
const data = YAML.parse(file);
89+
const data = YAML.parse(file.replaceAll('!!python/name:', ''));
9090
let ops = [];
9191
modified.forEach((filename) => {
9292
ops.push({ index: { _index: 'oiwiki', _type: 'article', _id: filename } });
@@ -160,7 +160,7 @@ function init() {
160160
exec(`curl -X DELETE "http://${esHost}/oiwiki"`);
161161
let modified = [];
162162
const file = String(fs.readFileSync(`${articlePath}/mkdocs.yml`));
163-
const data = YAML.parse(file);
163+
const data = YAML.parse(file.replaceAll('!!python/name:', ''));
164164
traversalArticle(data['nav'], (key, value) => modified.push(value));
165165
updateContent(modified, []);
166166
}

0 commit comments

Comments
 (0)