New project
How to create a fresh Jekyll project
GitHub Pages light approach
- Create a new empty repo.
- Go to the Settings of repo.
- Go to the GitHub Pages section.
- Choose your main branch and enable.
- Choose a theme, using one of two approaches.
- Use the GitHub UI - change theme on the current section of Settings. This will create a config file and
README.md
file (warning: this will overwrite an existingREADME.md
, which happened me). - Create a config file manually, then add theme as
theme: NAME
orremote-theme: USER/NAME
.
- Use the GitHub UI - change theme on the current section of Settings. This will create a config file and
- Optionally create an
index.md
file.
CLI
Whatever approach you use, pay attention to whether you have Jekyll 3 or 4.
Use global
If you have Jekyll installed globally.
$ jekyll new my-site
$ cd my-site
Use existing project
If you have Jekyll in an existing project, you can use that.
$ cd my-site-a
$ bundle exec jekyll new ~/repos/my-site-b
$ cd ~/repos/my-site-b
Use project Jekyll from scratch
This does not require Jekyll globally or installed in any existing projects locally.
This flow sets up a Jekyll site with no content but just the sufficient gems, at the project scope in vendor
.
Then that project-level Jekyll is used to make a new Jekyll scaffolded repo using the CLI, overwriting the content of the current directory, which are no longer needed.
See gist.
Use a template
Jekyll 3 blog
- Go to this repo:
- Click the Use this template button to get a repo.
- Follow the repo’s docs to set up Jekyll locally and on GitHub Pages.
Jekyll 4 and GitHub Actions
If you’re interested in Jekyll 4 specifically.
- Go to this repo:
- Click the Use this template button to get a repo.
- Follow the repo’s docs to set up Jekyll locally and on GitHub Pages.
- You just need to enable your site under GitHub Pages under Settings.
- GitHub Actions will already be configured for you. You don’t even have to set a token.
Jekyll 4 and Netlify
The above template also will work on Netlify.
Delete the GitHub Actions workflow and set up a Netlify config - see this Jekyll Netlify recipe.