This guide covers all essential aspects of GitHub Pages and Jekyll, along with key links and official documentation.
GitHub Pages is a static site hosting service that allows you to host personal, organization, or project websites directly from a GitHub repository.
https://<username>.github.io/
or https://<orgname>.github.io/
https://<username>.github.io/<project-name>/
gh-pages
for project pages).https://<username>.github.io/<repository-name>/
.Official Documentation:
GitHub Pages Documentation
Jekyll is a static site generator integrated with GitHub Pages. It converts plain text into websites, blogs, or other formats.
_posts
directory (YYYY-MM-DD-title.md
).about.md
or contact.md
.gem install bundler jekyll
jekyll new my-awesome-site
cd my-awesome-site
bundle exec jekyll serve
The site will be hosted locally at http://localhost:4000/
.
You can use custom themes or apply one of the many GitHub-provided themes. Add the theme to your Gemfile
and reference it in _config.yml
.
Official Documentation:
Jekyll Documentation
GitHub Pages natively supports Jekyll. No additional setup is required to run Jekyll on GitHub Pages.
gh-pages
or main
branch)._config.yml
file for custom settings, layouts, and themes._config.yml
.Stores configuration data for the site. Example:
title: My Awesome Site
description: >-
A blog about coding.
baseurl: "/blog"
url: "https://myusername.github.io"
theme: minima
Defines dependencies (e.g., Jekyll and plugins).
Jekyll supports plugins for additional functionality such as SEO and sitemaps. Popular plugins include:
Gemfile
:
gem 'jekyll-sitemap'
_config.yml
:
```yaml
plugins:
Once your Jekyll site is set up, deploy it to GitHub Pages by pushing changes to the correct branch.
main
or gh-pages
).https://<username>.github.io/<repository>
.Note: GitHub Pages runs Jekyll in safe mode, allowing only specific plugins. For unsupported plugins, build your site locally and push the HTML files to GitHub Pages.
You can set up a custom domain for your GitHub Pages site:
CNAME
file to the repository root containing your domain name (e.g., www.example.com
).If your site isn’t updating or you encounter build issues, check the build logs on GitHub under the Actions tab. Locally, run:
bundle exec jekyll serve
to troubleshoot errors.