Debug Jekyll with VSCode
13 Jul 2023 in TIL
I needed to debug some custom Jekyll plugins using VSCode. Here’s how I did it:
- Install https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg
- Install the
debug
gem globally withgem install debug
- Create a
.vscode/launch.json
file in the project with the following contents (you may need ):
js
// .vscode/launch.json{"version": "0.2.0","configurations": [{"type": "rdbg","name": "Debug Jekyll","request": "launch","script": "bin/jekyll build --config _config.yml --profile","args": [],"askParameters": false,}]}
- Ensure that
bin/jekyll
exists by runningbundle binstubs jekyll
- Create a breakpoint then run by pressing
F5
or runningStart Debugging
from the command palette.
You should now be able to inspect the running process using the debug tools available in VSCode.