Welcome to Advanced GIS, Lecture 11
This is a web page that can be viewed as slides.
→ to move forward
← to go back
dates to remember
April 28 and May 5: final project presentations
May 9: final projects due
GitHub
in GitHub, projects are kept in repositories, or repos for short
source
you can think of repos as folders
source
you can store anything in a repo, including data
source
many tech-focused jobs will require some GitHub knowledge
GitHub Pages: free web hosting
source
once you get your code on GitHub, they'll display those pages for free
source
and GitHub Pages perform better for viewers than Glitch
source
there are a few ways to put your code in GitHub:
the command line
we'll use Glitch
two phases:
1. initial setup
2. updating the code
1. initial setup
use a descriptive repository name (doesn't have to match your Glitch project name)
initialize with a README
2. updating the code
authorize (just the first time)
when you're done you'll have two URLs to keep track of:
1. the GitHub repo
https://github.com/ebrelsford/carto-sidebar/
like the code view in Glitch
https://github.com/ebrelsford/carto-sidebar/
this will always be at github.com
https://github.com/ebrelsford/carto-sidebar/
2. the GitHub Pages site
https://ebrelsford.github.io/carto-sidebar/
like the "show" view in Glitch
https://ebrelsford.github.io/carto-sidebar/
this will always be at github.io
https://ebrelsford.github.io/carto-sidebar/
likely issues
blank page!
in developer tools, JS and CSS aren't loading
the browser is looking at the wrong URL for styles.css
new Glitch projects often get files using /styles.css
/styles.css
means "put /styles.css" right after the domain"
this works fine in Glitch
https://flaxen-bait.glitch.me/styles.css
but not in GitHub
https://ebrelsford.github.io/styles.css
since the GitHub URL ends with the repo name
https://ebrelsford.github.io/my-map/
so you want to load styles this way:
https://ebrelsford.github.io/my-map/styles.css
pretty straightforward fix—add .
before the /
.
means "look in this folder"
is GitHub worth the effort?
depends!
since many tech and tech-adjacent work uses GitHub, it's good to get familiar with it
it's a bit easier to keep organized than Glitch
Glitch puts sites to sleep when they're inactive
GitHub Pages won't do this
my recommendation: use Glitch for small experiments, GitHub for projects you want to keep around
if you want, you can register a domain and point it at GitHub
source
or for free,
you can make an "organization" in GitHub
you get organizationname.github.io
GitHub isn't just for hosting web sites
other free data visualization tools