This is a tool to sync your leetcode discussion posts into an automatically generated blog. My blog is present at https://piyush01123.github.io/leetcode-blog. The blog has tags on each post and one can look up all the posts having a specific tag. Here are some screenshots:
- Fork this repo. Make sure to choose default branch
master
only - Save secrets
LEETCODE_CSRF_TOKEN
,LEETCODE_SESSION
andLEETCODE_ID
. To get the first two, sign-in on leetcode and copy from cookies for/api/home
. Here is an example. The third one is your username on leetcode.
- To save these as repo secrets, go to repo settings -> secrets and variables -> actions -> new repository secret and save the 3 variables
LEETCODE_CSRF_TOKEN
,LEETCODE_SESSION
andLEETCODE_ID
. - Go to Actions -> Sync My Leetcode Submissions -> Run workflow. Refesh to see logs. You can now verify that you have 3 branches
master
,leetcode
andlcblog
- Go to repo settings -> pages -> build and deployment. Select branch
lcblog
. - If everything has worked till now, you should now be able to see your blog at
${github_username}.github.io/leetcode-solutions
.
BONUS: It also syncs all your submissions (AC status) into another branch called ac_submissions
I have created this tool using minima theme but you can change the theme or add new plugins by tinkering with the template directory. Jekyll docs and Liquid docs will be helpful to get started.
This project was initially inspired from here.