All the steps I show you in the video are located at this repo in the README
👋 Novice alert!
I hope you find this video helpful, but I also want to point out I am at best a novice Docker user, so please be easy on me :-)
❓ What are Jekyll and GitHub Pages?
You may be aware GitHub offers a feature called GitHub Pages, which allows you to host your website for free.
💻 Jekyll and local development
There is a good chance you would like to build your Jekyll site locally to create, modify, or test the functionality before moving your site to production. Unfortunately, if you want to run Jekyll locally, you will have to install Ruby, Jekyll, and other dependencies.
Worse, if you use different versions of Jekyll, you may need different versions of Ruby on your computer. Getting all of that set up is a hassle and it is something I have struggled with over the last year.
📦 Docker containers: The easier way to develop locally
You can use Docker containers to essentially package up a "local" development environment without having to install Ruby or Jekyll on your computer.
👍 Benefits of developing in a container
You do not need to install Ruby or Jekyll on your computer. Instead, they reside in the container
Using my method, you can use it with x86 or ARM chipsets (x86 being Intel and ARM being things like Apple Silicon)
Every Jekyll container can have its own version of Ruby and or Jekyll, making it easy to switch from one to another (for example, I use Ruby 3.0.3 and Jekyll 4.2.x for my podcast website and Ruby 2.7 with Jekyl 3.9.2 for my company website)
By using Microsoft’s Remote-Containers extension in VSC, the code you write remains on your computer and runs in the container. That means if you accidentally delete the container, you do not lose your files.
While I cover these steps in the video, you will need the following to get started:
- A free Docker account, along with the Docker Desktop
- A free GitHub account
- A free copy of Visual Studio Code
- The following two free VSCode extensions:
Top comments (2)
Thank youuuu! I am a happy GitHub page/Jekyll user and I never had the time to set up my localhost environment!! 👏👏😊
You are very welcome, and I hope it works out for you. I’m happy to no longer worry about installing extra software on my local computer!