If you're interested in creating a personal blog or website, Jekyll is a popular static site generator that is easy to use once you understand the basics. This guide will walk beginners through the steps to set up a Jekyll blog from scratch.
Prerequisites
- A computer with internet access
- Basic knowledge of command line interfaces
- Ruby and RubyGems installed on your computer
- Text editor (like VS Code or Sublime Text)
Step 1: Install Ruby and Jekyll
First, ensure that Ruby is installed on your system. You can check by running ruby -v in your terminal. If not installed, download it from the official Ruby website. Once Ruby is installed, install Jekyll and Bundler by running:
gem install jekyll bundler
Step 2: Create a New Jekyll Site
Navigate to the directory where you want your blog to reside, then run:
jekyll new myblog
This command creates a new folder called myblog with all the necessary files.
Step 3: Serve Your Site Locally
Change into the new directory and start the local server:
cd myblog
bundle exec jekyll serve
Open your browser and go to http://localhost:4000. You should see your new Jekyll blog running locally.
Step 4: Customize Your Blog
Now that your site is up and running, you can start customizing:
- Edit the
_config.ymlfile to change site settings - Create new posts in the
_postsdirectory - Modify layouts and themes in the
_layoutsand_includesfolders
Step 5: Deploy Your Blog
Once you're satisfied with your blog, you can deploy it online using platforms like GitHub Pages. Push your site to a GitHub repository, then enable GitHub Pages in the repository settings. Your blog will be live with a GitHub Pages URL.
Creating a Jekyll blog from scratch is straightforward and offers great flexibility for customization. With practice, you'll be able to build a professional-looking site suited to your needs.