- Navigate to a repo where you have your Jekyll static site (maybe your GitHub pages site)
- Launch Codespaces (Code button -> Cloud -> New codespace on current branch)
- Once it's launched, run the following in the terminal
gem install bundler jekyll
bundle update
bundle exec jekyll serve
That's it - you will get a new tab to view the rendered work as you edit. So easy!
I've been slow to return to this and try it out but I am now also trying the devcontainer approach for a prebuild.
franc703 adds in Node which is more than I need.
There's a community one https://github.com/devcontainers/images/tree/main/src/jekyll but that also seems to do a lot that I don't immediately need - tho' it looks more robust, eg trying to find the correct bundler.
I went back to basics, partly to teach myself more about devcontainers (my first time using them) and tried to implement jacobdepriest's original script, which still works for me. It ended up pretty simple; I needed a folder
.devcontainer
and within that a filedevcontainer.json
which looks like this:Once you start the container Jekyll is not available immediately. It takes a little bit of time for the postCreateCommand to complete. However, the container started very quickly whereas when I tried putting these commands in a Dockerfile it just shifted the delay to the container build.