LeetCode Site Generator
Generate your personal LeetCode website with one command!
Example Website
Requirements
Features
- Support both
leetcode.com
andleetcode-cn.com
accounts.
Installation
yarn global add leetcode-site-generator
or npm i -g leetcode-site-generator
Usage
- Run installation script:
leetcode-site init
, This will create a project calledleet-site-base
on your current directory. - Go to the
website
directory ofleet-site-base
, runyarn download
. It will open a popup window and ask you to input your LeetCode username and password. - Waiting for downloading process finished, then run
yarn & yarn start
.
Publish to Github pages
- Change the following keys in
siteConfig.js
const siteConfig = {
// ...
url: 'https://beizhedenglong.github.io', // Your website URL
baseUrl: '/leetcode-site-generator/', // Base URL for your project
projectName: 'leetcode-site-generator', // Your project name
organizationName: 'beizhedenglong', // Your github username
// ...
}
- Run
GIT_USER=<your github username> CURRENT_BRANCH=master USE_SSH=true yarn run publish-gh-pages
List of commands
Usage: leetcode-site [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
download [options] Download your new accepted code from LeetCode.
init Generate your personal LeetCode website.
login Log in to your Leetcode account.
logout Log out of current account.
download
Usage: download [options]
Download your new accepted code from LeetCode.
Options:
-a, --all Download all your accepted code from LeetCode.
-h, --help output usage information