Jekyll is a popular static site generator used for creating blogs and static websites. Jekyll allows you to write your content in Markdown or HTML and then converts these into static HTML files. This makes your site fast and secure since it doesn’t need to pull data dynamically from a database.
Simple Setup: Easily installed with Ruby. Markdown Support: Writing content in Markdown makes formatting easy. Themes and Plugins: Extensive support for themes and plugins allows you to personalize your site. GitHub Pages Integration: Works seamlessly with GitHub Pages for easy publishing.
First, we need to install Jekyll and Bundler. Open your terminal and run the following commands:
gem install jekyll bundler
To create a new Jekyll site, use the command:
jekyll new my-awesome-blog
cd my-awesome-blog
To run the site locally:
bundle exec jekyll serve
You can now view your site in your browser at http://localhost:4000.
Navigate to the _posts directory and create a new Markdown file. The filename should follow this format: YYYY-MM-DD-title.md.
For example: 2024-06-20-my-first-post.md
The content of the file could be:
---
layout: post
title: "My First Post"
date: 2024-06-20 10:00:00 +0000
categories: jekyll update
---
Writing my first post with Jekyll!
Create a new repository on GitHub. Name the repository username.github.io.
In your terminal, follow these steps:
---
git init
git add .
git commit -m "Initial blog setup"
git branch -M main
git remote add origin https://github.com/username/username.github.io.git
git push -u origin main
Go to your repository settings on GitHub and click on the “Pages” section. Select the “main” branch as the source and save.
Within a few minutes, your site will be live at https://username.github.io.
Jekyll is an excellent tool for creating blogs and static websites. With a simple setup process, Markdown support, and GitHub Pages integration, you can quickly create and publish your own blog site. If you want to further customize your site, don’t forget to explore Jekyll’s wide range of themes and plugins!