Women Who Code DC Front End Hack Night (FEHN) Lead
Microsoft SharePoint technical consultant for the DoD
I want you to leave this class with the knowledge and tools to build your own website using GitHub Pages.
Open = Free, available, public, transparent
Source = software source code
Public repositories on GitHub are open source.
Contrast with commercial proprietary software.
Distributed version control software for source code
Distributed = a copy (repository) on your machine, not one copy on a central server
Created in 2005 by Linus Torvalds (Linux kernel).
Software to help you write software
Website that hosts public and private Git repositories
Collaborate with others
Distribute and share your code
Public web site hosting on GitHub's servers via Git repositories
User pages = http://username.github.io/
Organization pages = http://organization.github.io/
Project pages = http://username.github.io/my-cool-project
Unless you use Jekyll!
Free cloud-based integrated development environment (IDE)
Each workspace is its own Linux Ubuntu Docker container
40+ programming languages
My goal is to help eliminate any technical barriers to setting up your own personal website so you can instead focus on the code and the content.
.md = Markdown
"Text-to-HTML conversion tool"
GitHub uses GitHub Flavored Markdown
You can use Emojis!
GUI = Graphical User Interface
# Create a new file touch index.html
Why learn bash? Because it saves time
Builds command line interface (CLI) skills
CLIs used in SASS, bower, Node.js, and Ruby
# Create a new file touch index.html # Create a new directory (folder) # mkdir = "Make directory" mkdir css # Change the current directory # cd = "Change directory" cd css # Create CSS stylesheet touch styles.css
# Open file in Cloud9 c9 index.html
# Where am I? What's my working directory? # pwd = "Print working directory" pwd # returns /home/ubuntu/workspace/css # List files in current directory # ls = "list" ls # returns styles.css # Go back a directory (to the parent) cd .. # Go back two directories cd ../.. # Clear all text in the terminal clear
# Remove a file # rm = "Remove" rm styles.css # Remove a directory containing files # -r = "Recursive" rm -r css # Delete empty directory # rmdir = "Remove directory" rmdir js
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>My Personal Website</title> <link href="css/styles.css" rel="stylesheet" type="text/css"> </head> <body> <div class="container"> <h1>My Personal Website</h1> <p>Here's a puppy</p> <img src="img/Dougie-the-Shih-Tzu.jpg"> </div> </body> </html>
# Add one file git add index.html # Add all current untracked files git add --all
# Commit changes to the local working directory # -m = "Message" git commit -m "My first commit"
# Push changes to GitHub repository on the master branch git push origin master
Branches allow us to safely isolate changes or work on multiple features in parallel
# Create a new branch git branch css # Switch to the new branch git checkout css # Shortcut - create and switch to new branch git checkout -b css
# Add modified styles.css to tracked files in CSS branch git add --all # Commit changes to CSS branch git commit -m "Set default font family to Sans Serif" # Push changes to CSS branch on Github # NOTE we are pushing to "origin css" not "origin master" git push origin css
We need to merge our changes in the css branch with the master branch.
# Check out the master branch git checkout master # Merge the CSS branch with the master branch git merge css # Push changes from merge back to master branch on Github git push origin master
# Delete the remote branch on Github git push origin --delete css # Delete the local branch # -d = "Delete" git branch -d css # View available branches git branch
If an update is not showing on your site despite pushing the changes to GitHub, open up your browser's developer tools and disable caching.
Google Chrome Developer Tools = Ctrl + Shift + J
Make sure "Disable cache" is checked, then refresh the page.
These use the gh-pages branch of any repository, as long as you have already created a User Pages repository.
# Create the gh-pages branch git branch gh-pages # Checkout the gh-pages branch git checkout gh-pages # Push the gh-pages branch to GitHub git push origin gh-pages
NOTE: Project Pages URLs are case sensitive!
Allows certain files, file extensions, and folders to be excluded from your Git repository.
Particularly useful for Node.js applications.
To enable in Cloud9, show hidden files.
Sometimes may have to add the hidden .c9 folder to a .gitignore file.
Get notifications of any new pull requests or issues.
I used namecheap
CNAME = canonical name
DNS (Domain Name System) record
Points an alias (domain name), to another domain name (canonical name).
For example, alexandraulsh.com is the alias for alulsh.github.io.
CNAME file does not have a file extension.
Domain name needs to point to Github's servers.
Check out Search Engine Optimization (SEO) and Google Analytics.
Check out some personal websites of awesome women and non-binary people in the DC Tech scene.