Step-by-Step Guide to Running Jekyll Minimal Mistake Blog on Windows
Jekyll is a fantastic tool for building static websites, and the Minimal Mistakes theme offers a professional, clean design for blogs. This guide will walk you through the steps to build, run, and deploy your Jekyll blog on Windows and host it on GitHub Pages.
Step 1: Install Ruby and Development Kit
- Download and install Ruby+Devkit from RubyInstaller. During installation, ensure you select the option to add Ruby executables to your PATH.
-
Configure Ruby and the Development Kit:
ridk install -
Verify the installation:
ruby --version gem --version
Step 2: Install Jekyll and Bundler
-
Install Bundler, the Ruby dependency manager:
gem install bundler -
Install Jekyll:
gem install jekyll -
Confirm the installation:
jekyll --version
Step 3: Create Your Blog with Minimal Mistakes Theme
-
Clone the Minimal Mistakes starter repository:
git clone https://github.com/mmistakes/minimal-mistakes.git my-blog -
Navigate to your blog directory:
cd my-blog - Install project dependencies:
bundle install - Serve the blog locally to preview it:
bundle exec jekyll serve - Open your browser and visit:
http://localhost:4000
Step 4: Customize Your Blog
-
Update Configuration:
Edit_config.ymlto personalize your blog’s title, description, author, and other settings. -
Add Posts:
Add new blog posts in the_postsfolder. Use the format:YYYY-MM-DD-post-title.md
*Customize Pages:
Create new pages (e.g., about.md) and link them in _config.yml.
Step 5: Deploy Your Blog to GitHub Pages
- Initialize a Git repository in your project directory:
git init git add . git commit -m "Initial commit" - Create a new repository on GitHub and link it to your local project:
git remote add origin <repository-url> git branch -M main git push -u origin main - Enable GitHub Pages:
- Go to your GitHub repository’s Settings.
- Under Pages, set the branch to
mainand the folder to/ (root). - Save your changes.
- Your blog will be live at:
https://<username>.github.io/<repository-name>/
Build and deploy release for production
- Go to the root direcotry of the project. Ex. My-blog
- Open terminal and run command
jekyll build site.url - Go to the site directory. Ex. My-blog/site
- Copy the content of the site directory
- Go to the root directory of the repository on GitHub. Ex. mahedee.github.io
- Paste the content to the root directory
- Commit and push the changes to the repository on GitHub both my-blog and mahedee.github.io
- Now browse the site using: https://mahedee.github.io/
Troubleshooting
-
Changing the Site URL for Production
- You don’t need to manually change links when switching between development and production. Instead, set the “url” parameter in
_config.yml. - This approach has two benefits:
- When running
jekyll serve, thesite.urlis set tohttp://localhost:4000. - When running
jekyll build, thesite.urlis replaced with the domain name specified in_config.yml.
- When running
- After building, deploy the contents of the
_sitedirectory to the root of your server where your domain points.
- You don’t need to manually change links when switching between development and production. Instead, set the “url” parameter in
Conclusion
Deploying a Jekyll blog with the Minimal Mistakes theme on Windows is straightforward. With Ruby, Jekyll, and GitHub Pages, you can easily create, customize, and host a beautiful static website. Follow this guide to get your blog up and running today!
Comments