upload videos

This commit is contained in:
锦恢 2023-12-13 11:27:50 +08:00
parent f13b0f6150
commit 101e5fd846
3 changed files with 21 additions and 2 deletions

View File

@ -2,7 +2,7 @@
```bash
$ yarn install
$ $Env:NODE_OPTIONS="--openssl-legacy-provider"
$ yarn build
$ yarn build; node make.js
```
`./src/.vuepress/dist` 下文件夹上传到 `https://github.com/Digital-EDA/doc`

19
make.js Normal file
View File

@ -0,0 +1,19 @@
const fs = require('fs');
const path = require('path');
function replaceInFiles(dir, searchStr, replaceStr) {
fs.readdirSync(dir).forEach(file => {
let filePath = path.join(dir, file);
let stats = fs.lstatSync(filePath);
if (stats.isDirectory()) {
replaceInFiles(filePath, searchStr, replaceStr);
} else if (filePath.endsWith('.html')) {
let data = fs.readFileSync(filePath, 'utf8');
let newData = data.replace(searchStr, replaceStr);
fs.writeFileSync(filePath, newData);
}
});
}
replaceInFiles('./src/.vuepress/dist', /\/videos\//g, '/doc/videos/');

View File

@ -1,7 +1,7 @@
const { description } = require('../../package')
module.exports = {
base: './',
base: '/doc/',
title: 'Digital-IDE',
description: description,
head: [