This repository contains a template for creating a GitHub Pages site using Jekyll and GitHub Actions. It uses the Just the Docs theme and includes a basic structure for a documentation site with a blog.
-
Create a new repository
- Go to GitHub and create a new repository.
- You can name it anything you like, but
<username>.github.iowill create a user or organization site.
-
Clone the repository
git clone https://github.com/<username>/<repository-name>.git cd <repository-name>
-
Add template files
- Copy the following files into your repository:
_config.ymlindex.mdabout.mdblog.md.github/workflows/github-pages.ymlGemfile
- Copy the following files into your repository:
-
Create necessary directories
mkdir _posts _docs
-
Configure GitHub Pages
- Go to your repository on GitHub
- Navigate to Settings > Pages
- For "Source", select "GitHub Actions"
-
Create gh-pages branch
git checkout -b gh-pages git push origin gh-pages
-
Commit and push your changes
git add . git commit -m "Initial commit with Jekyll structure and GitHub Actions" git push origin main
-
Wait for GitHub Actions to build and deploy
- Go to the "Actions" tab in your repository to monitor the progress
- Once complete, your site will be live at
https://<username>.github.io/<repository-name>
-
Theme customization
- Create a
_sassdirectory for custom SCSS files - Override theme variables or add your own styles
- Create a
-
Navigation
- Modify the
navsection in_config.ymlto update the site navigation
- Modify the
-
Content
- Add new markdown files to the root directory or
_docsfor new pages - Add new blog posts as markdown files in the
_postsdirectory, namedYYYY-MM-DD-title.md
- Add new markdown files to the root directory or
-
Front Matter
- Use front matter in your markdown files to control page-specific settings
- Example:
--- layout: page title: My New Page nav_order: 4 ---
-
Custom Plugins
- Add desired Jekyll plugins to your
Gemfile - Update
_config.ymlto include new plugins
- Add desired Jekyll plugins to your
.
├── _config.yml
├── _posts/
│ └── YYYY-MM-DD-example-post.md
├── _docs/
│ └── example-doc.md
├── .github/
│ └── workflows/
│ └── github-pages.yml
├── Gemfile
├── index.md
├── about.md
└── blog.md
If you encounter any issues or have questions, please open an issue in this repository.
Happy coding!