This guide will show you how to easily install Jekyll on your macOS system using Homebrew. We'll walk you through the installation process and provide essential steps for setting up your Jekyll development environment.
Prerequisites
Homebrew: Homebrew is a popular package manager for macOS that simplifies the installation process. If you don't have it installed, follow the instructions on the Homebrew website
Install Ruby and RubyGems
Using Homebrew: Homebrew provides a convenient way to install Ruby and RubyGems:
brew install ruby
Install Jekyll
WUsing RubyGems:
gem install jekyll bundler
Verify Installation
Check the Jekyll version:
jekyll -v
Create a New Jekyll Site
Create a new directory for your Jekyll site:
mkdir my-jekyll-blog
cd my-jekyll-blog
Initialize a new Jekyll site:
jekyll new .
Run Jekyll Locallyz
Start the Jekyll server:
bundle exec jekyll serve
Open your web browser and visit http://127.0.0.1:4000/ to see your newly created Jekyll site.
Building Your Site
To build your site for deployment:
bundle exec jekyll build
This will generate a static HTML, CSS, and JavaScript files in the _site directory.
That's it! You've successfully installed Jekyll on your macOS and created a basic Jekyll site. You can now start customizing your site, adding content, and deploying it to a web server.
Additional Tips:
- Refer to the jekyllrb.comofficial Jekyll documentation for detailed information, advanced features, and troubleshooting
- Consider using a version control system like Git to track changes to your Jekyll site.
- Explore Jekyll plugins to extend its functionality.