[go: nahoru, domu]

Skip to content

Lashuk1729/leetcode-blog

 
 

Repository files navigation

Leetcode Blog

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:

Screenshot 2023-03-31 at 6 48 39 AM Screenshot 2023-03-31 at 6 49 52 AM
Screenshot 2023-03-31 at 6 52 08 AM Screenshot 2023-03-31 at 6 50 10 AM

How to create your own leetcode blog

  1. Fork this repo. Make sure to choose default branch master only
  2. Save secrets LEETCODE_CSRF_TOKEN, LEETCODE_SESSION and LEETCODE_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.

  1. 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 and LEETCODE_ID.
  2. Go to Actions -> Sync My Leetcode Submissions -> Run workflow. Refesh to see logs. You can now verify that you have 3 branches master, leetcode and lcblog
  3. Go to repo settings -> pages -> build and deployment. Select branch lcblog.
  4. 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

Customize your leetcode blog

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.

Acknowledgement

This project was initially inspired from here.

About

Auto-generate blog from your leetcode discuss posts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 49.9%
  • HTML 45.3%
  • Ruby 4.8%