First Example
Create a new Jekyll site at ./myblog
.
Change into your new directory.
Build the site and make it available on a local server.
Browse to http://localhost:4000
Creating a GitHub Pages site with Jekyll
Navigate to the location where you want to store your site’s source files,
replacing PARENT-FOLDER
with the folder you want to contain the folder for your repository.
Initialize a local Git repository, replacing REPOSITORY-NAME
with the name of your repository.
Change directories to the repository.
To create a new Jekyll site, use the jekyll new
command:
Open the Gemfile
that Jekyll created.
Add “#” to the beginning of the line that starts with gem "jekyll"
to comment out this line.
Add the github-pages
gem by editing the line starting with # gem "github-pages"
. Change this line to:
Replace GITHUB-PAGES-VERSION
with the latest supported version of the github-pages
gem.
You can find this version here: “Dependency versions.”
The correct version Jekyll will be installed as a dependency of the github-pages
gem.
Save and close the Gemfile
.
From the command line, run bundle update
.
Add your GitHub repository as a remote, replacing USER
with the account that owns the repository and REPOSITORY
with the name of the repository.
Push the repository to GitHub, replacing BRANCH
with the name of the branch you’re working on.