项目作者: yjl9903

项目描述 :
Competitive Programming Statistic
高级语言: TypeScript
项目地址: git://github.com/yjl9903/CPany.git
创建时间: 2021-08-18T17:35:43Z
项目社区:https://github.com/yjl9903/CPany

开源协议:MIT License

下载


🥖 CPany

@cpany/cli"">version Demo build-test

Competitive Programming Statistic Analysis Site Generator.

Screen shot

Getting Started

Use CPany template cpanyjs/template to create your own repository for data storage.

Update config file cpany.yml, and push the changes to Github.

Then, Github Actions will automatically fetch data and push to your repository!

Deploy

You can use Netlify, Vercel, Github Pages, etc. to deploy generated static site.

Netlify

The template repository has provided Netlify config file netlify.toml with the following content.

  1. [build.environment]
  2. NODE_VERSION = "14"
  3. [build]
  4. publish = "dist"
  5. command = "npm run build"
  6. [[redirects]]
  7. from = "/*"
  8. to = "/index.html"
  9. status = 200

Then you can just create a new CPany site with your repository on Netlify.

Vercel

The template repository has provided Vercel config file Vercel.json with the following content.

  1. {
  2. "rewrites": [
  3. { "source": "/(.*)", "destination": "/index.html" }
  4. ]
  5. }

Then you can just create a new CPany site with your repository on Vercel.

Github Pages

The template repository has also provided a workflow gh-pages.yml, which will automatically push the generated static site to the branch gh-pages. You can just enable Github Pages in the Settings of your repository.

Run locally

Install Node.js >= 14.

Run one of the following commands to install @cpany/cli"">@cpany/cli globally.

  1. # npm
  2. npm i -g @cpany/cli
  3. # yarn
  4. yarn global add @cpany/cli

Create an empty foler, and create cpany.yml in this new folder.

  1. # prepare folder
  2. mkdir cpany-data
  3. cd cpany-data
  4. echo "users:" > cpany.yml
  5. echo " tourist:" >> cpany.yml
  6. echo " handle/codeforces: tourist" >> cpany.yml

Fetch data, and start your static site.

  1. # fetch data
  2. cpany action
  3. # Start dev server
  4. cpany dev
  5. # Build static site
  6. cpany build

License

MIT License © 2021 XLor