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
debuggem globally withgem install debug - Create a
.vscode/launch.jsonfile 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/jekyllexists by runningbundle binstubs jekyll - Create a breakpoint then run by pressing
F5or runningStart Debuggingfrom the command palette.
You should now be able to inspect the running process using the debug tools available in VSCode.