├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── config.json ├── helper ├── __init__.py ├── config.py ├── constants.py ├── extractor.py ├── login.py ├── main.py ├── node.py ├── problems.py ├── templates.py └── utils.py ├── imgs ├── leetcode-logo.png └── leetcode_dashboard.png ├── run.py ├── tests ├── __init__.py └── test_config.py └── update_leetcode_dashboard.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | db/ 2 | .vscode 3 | **/__pycache__ 4 | **/.ipynb_checkpoints/ 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Herbert Lu, KivenChen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## hugo-leetcode-dashboard 2 | 3 | ✨ 一个 LeetCode 答题看板的生成插件, 支持一键部署到 Hugo 站点。 **完整记录刷题心路历程** ✨ 4 | 5 | [在线预览 Demo](https://blog.herbert.top/leetcode/) 6 | 7 | ## Screenshots 8 | 9 | ![leetcode-dashboard](https://raw.githubusercontent.com/lryong/hugo-leetcode-dashboard/master/imgs/leetcode_dashboard.png) 10 | 11 | ## Installation 12 | 13 | 1. 下载 Repo 到本地: 14 | 15 | ```shell 16 | git clone https://github.com/lryong/hugo-leetcode-dashboard 17 | ``` 18 | 19 | 2. 安装依赖: 本项目需要用到 `requests` 和 `aiohttp` 包, 通过 pip 安装即可。 20 | 21 | 3. 更新仓库根目录下的 `config.json`文件: 22 | 23 | ```json 24 | { 25 | "username": "leetcode-cn@leetcode", 26 | "password": "leetcode", 27 | "outputDir": "../LeetCode" 28 | } 29 | ``` 30 | 31 | username 是 LeetCode-cn 账号, password 是对应密码。 32 | outputDir 为 dashboard 生成路径。 (注: 这里配置为 hugo 站点的文档路径, 如:/Users/XXX/my_blogs/content) 33 | 34 | 4. 因为 Hugo 默认只支持 _markdown_ 文档, 在个人网站根目录下新建 `layouts/shortcodes/rawhtml.html`文件,以支持原生 HTML: 35 | 36 | ```css 37 |