mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
Convert bin/ shell scripts to Node.js and npm scripts using shx and npm-run-all2. Remove unused build-icons.sh. Inlined simple scripts (build-docs-liquid, build-apidoc) as npm scripts. Made-with: Cursor
25 lines
818 B
JavaScript
25 lines
818 B
JavaScript
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const root = path.resolve(__dirname, '..')
|
|
const src = path.join(root, 'CHANGELOG.md')
|
|
|
|
let content = fs.readFileSync(src, 'utf8').replace(/\r\n/g, '\n')
|
|
|
|
const lines = content.split('\n')
|
|
lines[0] = lines[0]
|
|
.replace(/"/g, '"')
|
|
.replace(/</g, '<')
|
|
.replace(/>/g, '>')
|
|
content = lines.join('\n')
|
|
|
|
content = content
|
|
.replace(/{%/g, '{% raw %}{%{% endraw %}')
|
|
.replace(/\{\{/g, '{% raw %}{{{% endraw %}')
|
|
|
|
const enFrontmatter = '---\ntitle: Changelog\nauto: true\n---\n\n'
|
|
const zhFrontmatter = '---\ntitle: 更新日志\nauto: true\n---\n\n'
|
|
|
|
fs.writeFileSync(path.join(root, 'docs/source/tutorials/changelog.md'), enFrontmatter + content)
|
|
fs.writeFileSync(path.join(root, 'docs/source/zh-cn/tutorials/changelog.md'), zhFrontmatter + content)
|