Jekyll container setup
Introduction
For local development, Jekyll can be run in server mode inside a container. It will watch for changes, rebuild the site, and provide access through its included web server.
Setup
-
Create the folders needed by the container
Run the following commands inside your home folder:
-
Create the script needed to run the container
Save the following script as
jekyll_run.sh
:Instructions:
- Optional Replace
docker
withpodman
if needed - Required Replace port number
4000
of0.0.0.0:4000
(on the left side of:
) with a port number that is available if needed - Optional Replace for example
$PWD/web
with the location of your website. Personally I used a fileserver mount which is also shared with a client pc where I can edit my notes - Required Replace
Europe/Amsterdam
with your own timezone
- Optional Replace
-
Run the script to create the container
Run the following command:
The image
jekyll/jekyll
is automatically pulled and the container is created. -
Check the results
Now you can check if the container is running properly. The log will show that it may take a while for the server to run.
Make sure you place your Jekyll website in the location which is mapped to
/srv/jekyll
in the script. You can check the results of changes by reloadinghttp://localhost:4000/
in a browser. Replace localhost with the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier.If changes are made to the source code or to notes (e.g. with [[Obsidian - Setup a Digital Garden with GitHub and Cloudflare Pages|Obsidian]]) Jekyll will automatically detect the changes and generate a new build.
No comments found for this note.
Join the discussion for this note on Github. Comments appear on this page instantly.