How to create a blog with Jekyll and GitHub Pages
Published:
Creating a blog with Jekyll and GitHub Pages is a great way to share your thoughts and projects with the world. In this post, I’ll walk you through the steps to set up your own blog.
Step 1: Install Jekyll
First, you need to install Jekyll on your local machine. Follow the Jekyll installation guide for your operating system.
gem install jekyll bundler
Step 2: Create a New Jekyll Site
Once Jekyll is installed, you can create a new Jekyll site by running the following command:
jekyll new my-blog
cd my-blog
Step 3: Test Your Site Locally Navigate to your new Jekyll site directory and start the Jekyll server to test your site locally:
bundle exec jekyll serve
Step 4: Set Up GitHub Pages
Create a new repository on GitHub. Then, push your Jekyll site to the repository. Follow the GitHub Pages documentation for detailed instructions.
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/yourusername/your-repo-name.git
git push -u origin main
Step 5: Configure Your GitHub Pages Site
Go to the repository settings on GitHub, scroll down to the “GitHub Pages” section, and select the branch you want to use for GitHub Pages (usually main or gh-pages).
Step 6: Customize Your Blog
Edit the _config.yml file in your Jekyll site to customize your blog’s settings, such as the title, description, and theme. You can find more information on customizing your Jekyll site in the Jekyll documentation.
Using the AcademicPages Template
If you want to create an academic website, you can use the academicpages template. This template is designed specifically for academic websites and includes features like publications, talks, and a customizable CV.
Step 1: Fork the Repository
Go to the academicpages repository on GitHub and click the “Fork” button to create a copy of the repository in your GitHub account.
Step 2: Clone the Repository
Clone the forked repository to your local machine or use Template.
Step 3: Customize the Template
Edit the _config.yml
file and other Markdown files in the repository to customize the template with your own information. Follow the instructions in the academicpages documentation for detailed guidance on customization.
Step 4: Deploy Your Site
Push your changes to GitHub and configure GitHub Pages as described in Step 5 above. Your academic website will be live at https://yourusername.github.io/academicpages.github.io.