Before we get started, let's clarify some terms:
Git is a popular free, distributed version control system–i.e. a piece of software used to track the history of changes in a folder of files. Git can be used on your personal computer, or by online services to track the development of a project, such as…
GitHub, a popular web platform for hosting Git repositories–i.e. a place to store and sync your project files online. Think of it as Google Drive for code with super robust "track changes" baked in. Built around the powerful version control of Git, it provides a handy web interface for managing, editing, and collaborating on repositories.
Also before we get started, if you don't have a Google account, please create one here.
- Go to https://github.com
- Click the "Sign up" button
- Enter your email and create a username and password to complete the sign up process
- Be sure to "skip personalization" and choose a free account
Copy code from the CollectionBuilder-GH repository into your own and start editing it. This code forms the template from which you will build your project during this workshop.
- Make sure you're logged into your account on GitHub
- Navigate to the collectionbuilder-gh GitHub repository and click the green "Use This Template" button (appears on the right side above the code area)
- This brings you to a "Create a new repository" form. Follow these steps:
- In the Repository name text box, give your repository the name
yokai-senjafuda
. If you'd like to create your own name for the repository, be sure to use a lowercase name without spaces or odd characters. Dashes (-
) or underscores (_
) are okay. - In the Description text box, add
A demo CollectionBuilder site
. - Select the option for "Public" repository.
- Leave the "Include all branches" option Unchecked!
- Click on the green button "Create repository from template". This will take you to your new repository.
- In the Repository name text box, give your repository the name
Explore your new repository. Note in particular these files and folders:
- README.md - notice it has links to instructions for using this template
- _config.yml - this controls elements of the site at a high level
- _data folder - contains the metadata spreadsheet that will control content on the site
- objects folder - contains images that build the website and a readme.md file with instructions on adding images to your project
- pages folder - contains markdown pages that will create the website
- Click on the
README.md
link. This will open your README file.
The README file is a place to describe your repository. By default, GitHub displays the README on the repository home page, so it is often the first place visitors will look for information about your project.
- In the top right corner of the README file, locate and click on the pencil icon.
You are now in GitHub's editing mode.
The first line at the top of the file will look like this:
# collectionbuilder-gh
- Delete this line of text and instead type
# My Project
. - Proceed to the following section to learn how to save or "commit" your changes.
When you make a commit, Git takes a snapshot of the changes you made and permanently stores it in your repository's history. Your "commit message" is a short description of what the changes do or why you made them--this is your note to the future to help everyone understand the code and history.
- To commit the changes you just made to your README file, scroll to the bottom of the page where you made your README edits. You'll see a box titled "Commit changes."
- In the text box directly underneath "Commit changes," type
update project title
, or a brief message of your choosing that indicates what changes you made to this file. - Skip the option to add an extended description to the commit, and keep the box checked next to "Commit directly to the main branch".
- Click on the green "Commit changes" button. This will take you back to your repository's homepage.
- Scroll down to the bottom of your repository to view the new title you added to the README file.
You can view recent commits on your repository's homepage. Commit messages and their timestamps are located to the right of the repository files:
Let's take a closer look at the changes you've made to the README file:
- On your repository's homepage, locate the README.md file link. To the right of the link, you should see the commit message you just created (it should say
update project title
). - Click on the commit message.
You should now see two versions of your README file, displayed side by side. You are viewing the difference between the original version of your repository's README file (on the left), and the new version that you created by editing it (on the right).
- Click your repository's name (located in the top left of the window) to return to the repository's home page.
Let's view all the changes we've made to the repository so far.
- On your repository's home page, locate the commit count for your repository, situated underneath the green "Code" button and to the right of the clock icon. It should display a number followed by the word "commits" (example: "2 commits"):
- Click on this commit count link.
You are now viewing your repository's history (all the commits that have ever been made to your repository).
- Click on the commit message
update project title
to view the changes that were made as part of that commit. - Click your repository's name (located in the top left of the window) to return to the repository's home page.
Now it's time to turn on the webpage associated with this project. This website is the digital project we will develop and update over the course of the workshop.
- On your repository's home page, locate and click the "Settings" link, which is the very top right menu item on the menu.
- Scroll down on the vertical "Settings" Menu and select "Pages" (the last link in the "Code and Automation" section).
- Under "Source," select the button that says "None", and choose "main" from the dropdown.
- Click the "Save" button to the right of the Source button, which now should read "branch: main."
- You should now see a notification saying "Your site is ready to be published at https://[YourUsername].github.io/yokai-senjafuda/" Select the link listed here and copy it.
- Navigate back to the homepage of your repository by clicking on the leftmost menu item in the top left of your screen, "<> Code." (Alternatively, click on the name of your repository, "yokai-senjafuda.")
- Click on the Settings gear icon located in the "About" box located to the right of the green "Code" button to bring up the "Edit repository details" screen.
- Paste your website url into the "Website" box, and click the green "Save Changes" button.
- Open the link to the website in the "About" section of your repository in a new window or tab and explore the website. Note that it may take as little as 30 seconds or as much as 15 minutes for your website to deploy. Before it has deployed, you will see a 404 error message when you click the link.
- Returning to your repository, click into the objects folder: note the images, which correspond to the images on the website, and the readme.md file with instructions on adding images to your project.
- Click into the pages folder: note that the names of the markdown pages here correspond to the names of the main page on the website.
- Note that these markdown pages are not the final pages served by Jekyll. Rather, they instruct Jekyll on how to create the final html pages served by GitHub pages. You can see that final html by navigating to the website. Right click “view page source” to see the html that creates these web pages.
- You can download the sample materials for our project using this link generated via DownGit. (If you are curious, the sample materials are in the student_resources folder of this GitHub repository. We use DownGit so you don't have to download the entire repository to access just these files.) |
- Upload the images you just downloaded to the images folder.
- Upload the senjafuda-metadata.csv file to the data folder.
- Navigate to the
_config.yml
and select the "pencil" button to go to editing mode. - Notice that this controls the configuration of the entire website.
- Change the settings to something similiar to what you see here, and put your name where it says "Your Name":
##########
# SITE SETTINGS
#
# title of site appears in banner
title: Yōkai Senjafuda
# tagline, a short phrase that will appear throughout the site in the top banner
tagline: Depictions of Japanese Ghosts and Monsters
# description appears in meta tags and other locations
# this description might appear in search result lists, keep around 160 characters max
description: "A digital exhibit made using CollectionBuilder"
# creator of the digital collection, to appear in meta tags; we typically use our GitHub usernames but feel free to just use your name
author: Your Name
##########
# COLLECTION SETTINGS
#
# Set the metadata for your collection (the name of the csv file in your _data directory that describes the objects in your collection)
# Use the filename of your CSV **without** the ".csv" extension! E.g. _data/demo-metadata.csv --> "demo-metadata"
metadata: senjafuda-metadata
- Note that it may take as little as 30 seconds or as much as 15 minutes for your website to deploy. Before it has deployed, there will be a small yellow circle below and to the left of the green Code button in your repository. If an error occurs, a red X will appear. When the website has successfully deployed, you will see a green check mark.
- Check the website, discover there are only 8 images appearing, and that there are text encoding errors for the macron (diacritical mark over the o) in several romanized Japanese words. UTF-8, the encoding Google Sheets uses for saving our CSVs, includes encoding for macrons. However, as this material was cut and pasted, the encoding was lost somewhere along the way.
- Navigate to Google Sheets, and create a new spreadsheet. For some basics on using spreadsheets, see this introduction.
- In a new tab, navigate to the student materials folder in this repository, and select the
senjafuda-metadata.csv
. Then select the "Raw" button in the top right hand corner to open just the contents of the csv. - Now select and copy the url associated with this metadata (https://raw.githubusercontent.com/learn-static/collectionbuilder-workshop/main/student_materials/senjafuda-metadata.csv).
- Now toggle back to your Google Sheets, and in cell A1, enter =IMPORTDATA("https://raw.githubusercontent.com/learn-static/collectionbuilder-workshop/main/student_materials/senjafuda-metadata.csv"). Instead of typing out the url, you can paste in between two quotes the web link you just copied.
- Now correct the errors you found in the website. Here are instructions to type a macron for Mac and instructions to type a macron for Windows
- Download the new Google sheets csv. Rename it senjafuta-metadata.csv.
- Re-upload, commit and confirm fix.