If you’re a developer looking for an efficient way to create and maintain static web pages for clients, Jekyll is one of the best options available. It’s a static site generator that makes creating HTML content and managing it easy without needing to rely on databases or complex CMS platforms.
Advantages of Using Jekyll
- Ease of use: With Jekyll, you can generate a website structure in a matter of seconds with a simple command. Its Markdown integration makes content editing fast and straightforward.
- Speed and performance: By generating static sites, pages load much faster than traditional CMS platforms, improving user experience and SEO.
- Flexibility and control: Unlike other content management systems, Jekyll allows you to fully customize your site without restrictions imposed by third-party platforms.
- Perfect for developers: If you already use Git and GitHub, Jekyll is ideal for hosting and deploying sites easily with GitHub Pages.
Installing Jekyll on Apple Silicon
For those using Mac with Apple Silicon processors, here’s a quick guide to install Jekyll and get started on your next web project.
1. Install Homebrew
Homebrew is a package manager that makes it easy to install development tools on macOS.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Configure Homebrew
Make sure to replace [yourusername] with your macOS username:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[yourusername]/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
export SDKROOT=$(xcrun --show-sdk-path)
3. Install Ruby 3.0.x
Install Ruby with Homebrew:
brew install ruby@3.0
Verify your Ruby installation:
ruby -v
Configure the path according to your shell (zsh or bash):
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
4. Install Jekyll and Bundler
Install the necessary gems:
gem install --user-install bundler jekyll
Configure the correct path:
echo 'export PATH="$HOME/.gem/ruby/3.0.0/bin:$PATH"' >> ~/.zshrc
Verify that the gems are correctly installed:
gem env
5. Create a new Jekyll site
Create a new project:
cd desktop
mkdir jekylltest
cd jekylltest
Recommended .gitignore file:
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata
.bundle/
vendor/
**/.DS_Store
Initialize the site with the Minima theme:
bundle init
bundle add jekyll --version "~>4.2"
bundle config set --local path 'vendor/bundle'
bundle install
bundle exec jekyll new --force --skip-bundle .
bundle add webrick
bundle install
bundle update
6. Run Jekyll’s local server
Start the local server:
bundle exec jekyll serve --livereload
This will generate a URL (usually ending in :4000) that you can open in your browser.
Jekyll is an excellent option for developers looking for a simple, fast, and efficient solution to create static websites.