Get started
What you need
- Ruby 3.3. GitHub Pages builds sites with Ruby 3.3. Ruby 4.0 does not work with the
github-pagesgem yet. See Install Ruby 3.3 below. - Bundler, which installs the other parts. After you install Ruby, run
gem install bundler. - Git, to copy the template and save versions of your work.
- A text editor, such as Visual Studio Code.
Make your own copy
- On GitHub, open the template repository and select Use this template, or fork it. You can also download it as a ZIP file.
- Copy your new repository to your computer with
git clone.
Install Ruby 3.3
Your computer may already have a different version of Ruby. A version manager lets you use Ruby 3.3 for this site and keep your other version for other work.
On a Mac, with Homebrew:
-
Install rbenv, the version manager:
brew install rbenv rbenv init - Close the terminal and open a new one.
-
Install Ruby 3.3. To see the newest 3.3 version, run
rbenv install --list. Then install it, for example:rbenv install 3.3.10 -
In the site folder, choose that version for this folder only:
rbenv local 3.3.10This makes a
.ruby-versionfile. rbenv uses it whenever you are in this folder. - Check:
ruby -vmust show 3.3. Then rungem install bundler.
On Windows, install Ruby 3.3 “with Devkit” from RubyInstaller.
If bundle install tries to install github-pages version 15 or jekyll version 1.4, you are using the wrong Ruby version. Stop it with Ctrl+C and check ruby -v.
See the site on your computer
- Open a terminal in the site folder.
-
Install the parts the site needs. You only do this once, and again if
Gemfilechanges:bundle install -
Start the preview:
bundle exec jekyll serve - Open the address that the terminal shows, such as
http://127.0.0.1:4000/. - When you save a file, the preview updates in a few seconds. Reload the page to see the change. If you change
_config.yml, stop the preview (press Ctrl+C) and start it again.
Make the site yours
Do these steps in this order:
- In
_config.yml, changetitle,description,url, andbaseurl. See Publish the site for what to put inurlandbaseurl. - In
_data/site.yml, change the contact details, the footer, and the home page text. See Change the settings. - In
_data/theme.yml, change the colors. See Change the colors and fonts. - Replace
[State]in the starter pages with the name of your state. Most editors can do this in all files at once (“Find in files”). - Write your pages. See Write and edit pages.