Skip to content

Commit

Permalink
chore: update website.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 10, 2022
1 parent 3204b75 commit dcb634c
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 565 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
push:
branches:
- main

jobs:
Build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16

- run: node build.js
- run: mkdir www
- run: cp -r build download github ico lang license open plugin progressed star status www

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
commit_message: ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./www
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
node_modules
www/*
!www/forkmeongithub.png

npm-debug.log*
lerna-debug.log
yarn-error.log
package-lock.json

.DS_Store
.cache
.vscode
.idea
.env

*.mpassword
*.bak
*.tem
*.temp
#.swp
*.*~
~*.*

# IDEA
*.iml
*.ipr
*.iws
.idea/
6 changes: 3 additions & 3 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function initData(dirname) {
const filesArr = []
files.forEach(async (_filename, idx) => {
_filepath = path.join(dirname, _filename)
if (_filename !== '.git' && _filename !== '.github' && _filename !== 'svg' && _filename !== '.DS_Store') {
if (_filename !== '.git' && _filename !== '.github' && _filename !== 'www' && _filename !== 'svg' && _filename !== '.DS_Store') {
if (isDir(_filepath)) {
data[_filename] = await initData(_filepath);
} else if (isFile(_filepath)) {
Expand All @@ -39,7 +39,7 @@ function initData(dirname) {

; (async () => {
await initData(path_root);
fs.writeFileSync(path.join(path_root, 'data.json'), JSON.stringify(data, null, 4));
fs.writeFileSync(path.join(path_root, 'data.json'), JSON.stringify(data, null, 2));

let ulStr = '';
let svgTotal = 0;
Expand All @@ -61,7 +61,7 @@ function initData(dirname) {
console.log();
console.log(` => 共有 \x1b[32;1m${svgTotal}\x1b[0m 个 SVG 文件`);
const htmlStr = fs.readFileSync(path.join(path_root, 'template.html'), 'utf8');
fs.writeFileSync(path.join(path_root, 'index.html'), htmlStr.replace('{{content}}', ulStr));
fs.writeFileSync(path.join(path_root, 'www', 'index.html'), htmlStr.replace('{{content}}', ulStr));
console.log(" => 写入文件 ok!!");
console.log();
const mdStr = fs.readFileSync(path.join(path_root, 'README.md'), 'utf8');
Expand Down
Loading

0 comments on commit dcb634c

Please sign in to comment.