Commit 868cc51f authored by 吕祺's avatar 吕祺 ⛹🏽

tojson

parent 3077e63c
...@@ -50,6 +50,7 @@ deploy: ...@@ -50,6 +50,7 @@ deploy:
- yarn - yarn
# - sh utils/imageCompress.sh # - sh utils/imageCompress.sh
- npm run export - npm run export
- node utils/toJSON.js
- rm -rf /home/gitlab-runner/deploy/cms/ronghui/out - rm -rf /home/gitlab-runner/deploy/cms/ronghui/out
- echo "预览页面已清除" - echo "预览页面已清除"
- cp -r out /home/gitlab-runner/deploy/cms/ronghui - cp -r out /home/gitlab-runner/deploy/cms/ronghui
......
...@@ -10,11 +10,12 @@ const storeData = (data, path) => { ...@@ -10,11 +10,12 @@ const storeData = (data, path) => {
} }
try { try {
const doc = yaml.loadAll(fs.readFileSync('../content/frontPage.md', 'utf8')); const doc = yaml.loadAll(fs.readFileSync('./content/frontPage.md', 'utf8'));
// console.log(doc[0]); // console.log(doc[0]);
storeData(doc[0], '../out/frontpage.json') storeData(doc[0], './out/frontpage.json')
} catch (e) { } catch (e) {
console.log(e); console.log(e);
throw(e)
} }
// console.log(yaml.loadAll(` // console.log(yaml.loadAll(`
// --- // ---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment