Lesson 1 - Getting Started
Create a Jekyll website from scratch.
Table of Contents
Create a New Repository in GitHub
- Sign into GitHub
- At the top-right, click the “+” Sign.
- Select “New Repository.”
- Under Owner, select your username.
- Under Repository name, type “my-website”.
- You will be redirected to a Quicksetup page. For now, you don’t need to touch the settings. We’ll return to this page in a moment…
See: GitHub’s Guide to Creating a Repo for more detailed info.
Create Jekyll Site
Note: To install and run Jekyll, you will need to use your computer’s *Command Line interface. See Installation Instructions
- Open Terminal (On a mac, type Cmd + spacebar) and search “Terminal.”
- Create your new Jekyll site *Note: you can choose any name! Here, I’ve chosen “my-website.”
jekyll new my-website
- Change into your new directory
cd my-website
- Build the website
bundle exec jekyll serve
See: Jekyll’s Quickstart Guide for more detailed instructions.
Modify Gemfile
- In the main folder, open the file “Gemfile.”
- Uncomment the line below, and replace GITHUB-PAGES-VERSION with the latest supported version of the github-pages gem. You can find this version here: “Dependency versions.”
- e.g. At the time of creating this module, the dependency for GitHub Pages is “228.”
gem "github-pages", "~> 228", group: :jekyll_plugins
- Add the following gem
gem "webrick"
Modify YML file
The YML file configures the main settings for your website. *Note: Make sure you have the correct URL. Capitalization and backslash placement matters!
- In the main folder, open the file “_config.yml”.
- Fill in the following fields:
- URL (main url) e.g. “https://cmiya.github.io”
- BaseURL (subpath) e.g. “/my-website”
- title
- description
- Github_username
Test file (locally)
- In Terminal, type:
bundle exec jekyll serve
- In your browser (Chrome), visit the URL:
http://localhost:4000/
If successful, you should see a preview of your page.
Key Points / Summary
- Local (i.e. your computer) vs. Remote (e.g. GitHub)
- Gemfile
- YML file