Commit 3077e63c authored by 吕祺's avatar 吕祺 ⛹🏽

tojson

parent 25386256
......@@ -20,9 +20,10 @@ compile_articles:
- node utils/articleAggregate.js
- sh utils/commit.sh
- npm run export
- node utils/toJSON.js
- rm -r /home/gitlab-runner/deploy/cms/ronghui/out
- cp -r out /home/gitlab-runner/deploy/cms/ronghui
- cp -r content /home/gitlab-runner/deploy/official/out
# - cp -r content /home/gitlab-runner/deploy/official/out
- echo "cms https://cmsadmin.gaorongvc.cn/ronghui/admin"
......@@ -52,7 +53,7 @@ deploy:
- rm -rf /home/gitlab-runner/deploy/cms/ronghui/out
- echo "预览页面已清除"
- cp -r out /home/gitlab-runner/deploy/cms/ronghui
- cp -r content out
# - cp -r content out
- /home/gitlab-runner/sh/ossutil64 cp -f out oss://touhou-cms/ -r
......
This diff is collapsed.
const yaml = require('./js-yaml.js')
const fs = require('fs');
const storeData = (data, path) => {
try {
fs.writeFileSync(path, JSON.stringify(data))
} catch (err) {
console.error(err)
}
}
try {
const doc = yaml.loadAll(fs.readFileSync('../content/frontPage.md', 'utf8'));
// console.log(doc[0]);
storeData(doc[0], '../out/frontpage.json')
} catch (e) {
console.log(e);
}
// console.log(yaml.loadAll(`
// ---
// MetaDescription: test
// articles:
// - title: 关于冒用高榕资本名义的严正声明
// - title: 关于冒用高榕资本名义的严正声明2
// rollimage1: /static/img/屏幕截图-2021-08-05-143335.png
// rollimage2: /static/img/屏幕截图-2021-08-05-143335.png
// rollimage3: /static/img/abstract_xinxingji_21-06-07.jpg
// bigevent:
// - title: 叮咚买菜成功登陆纽交所
// tag: 本周大事件
// btnText: 本周重磅
// cover: /static/img/abstract_xinxingji_21-06-07.jpg
// jumpName: 叮咚买菜成功登陆纽交所
// jumpUrl: ""
// - title: "创业者沟通实战课 — 脱不花 得到App CEO 7月15日·北京 7月15日,北京 "
// tag: "榕汇活动预告 "
// btnText: 即刻报名
// cover: /static/img/abstract_xinxingji_21-06-07.jpg
// jumpName: "创业者沟通实战课 — 脱不花 得到App CEO 7月15日·北京 7月15日,北京 "
// jumpUrl: ""
// - title: To B企业构建高质量增长体系 7月15日,北京
// tag: To B增长营
// btnText: 查看全部
// cover: /static/img/abstract_xinxingji_21-06-07.jpg
// jumpName: To B企业构建高质量增长体系 7月15日,北京
// jumpUrl: ""
// ronghui:
// - title: "2021全球To B领域12个新趋势与12个新增长模式 "
// subTitle: 刘新华 高榕资本合伙人、原快手首席增长官
// cover: /static/img/abstract_xinxingji_21-06-07.jpg
// jumpName: "2021全球To B领域12个新趋势与12个新增长模式 "
// jumpUrl: ""
// - title: 真高管团队打造
// subTitle: 房晟陶 首席组织官创始人、原龙湖集团CHO
// cover: /static/img/abstract_xinxingji_21-06-07.jpg
// jumpName: t
// jumpUrl: ""
// pr:
// - title: 水滴IPO传播
// subTitle: "独家对话沈鹏 "
// cover: /static/img/abstract_xinxingji_21-06-07.jpg
// jumpUrl: ""
// jumpName: t
// - title: "Nuro C轮融资 "
// subTitle: "核心媒体落地 "
// cover: /static/img/abstract_xinxingji_21-06-07.jpg
// jumpUrl: ""
// jumpName: t
// - title: "凌迪科技采访 "
// subTitle: "定制短视频 "
// cover: /static/img/abstract_xinxingji_21-06-07.jpg
// jumpUrl: ""
// jumpName: t
// ---
// `)
// )
\ No newline at end of file
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