git, github gh-pages and static websites

Post on 26-Jan-2017

278 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Git, GitHub and gh-pages

Central California Java User Group

03/11/2016, Bitwise South Stadium, Fresno, CA

Csaba Toth

About me Csaba Toth csaba.toth.us@gmail.com,@tocsa2

LinkedIn: http://www.linkedin.com/in/csabatothdev Polyglot full-stack developer (C++, Java, C#, Python) Full time remote developer of SportsBoard (WestShore Tech is

located in Sausalito, CA), living in Fresno, CA Plus has a consulting company Co-founder of Nashville JUG Founder of Central California JUG

Agenda Version control systems Distributed version control systems (vs centralized) Git GitHub gh-pages (Jekyll)

Version Control systems

Branching strategies

Branching strategies

Hosting static site on GitHub Perfect for static Twitter Bootstrap sketches Example: http://dealoround.com GitHub’s convention: gh-pages branch. Source

https://github.com/MrCsabaToth/DealORoundWebsite/tree/gh-pages

-> Site: https://mrcsabatoth.github.io/DealORoundWebsite

Hosting static site on GitHub Perfect for static Twitter Bootstrap sketches Example: http://dealoround.com GitHub’s convention: gh-pages branch. Source:

https://github.com/MrCsabaToth/DealORoundWebsite/tree/gh-pages

-> Site: https://mrcsabatoth.github.io/DealORoundWebsite

Hosting static site on GitHub Perfect for static Twitter Bootstrap sketches Example: http://dealoround.com GitHub’s convention: gh-pages branch. Source:

https://github.com/whateverify/Awesomeness/tree/gh-pages

-> Site: https://WhatEverify.github.io/Awesomeness

Steps http://blog.teamtreehouse.com/using-github-pages-to-host-your-

website

1. Create new repo

2. Add gh-pages branch

3. Pick Bootstrap template and customize or use Jekyll to generate site

4. Commit the site to the gh-pages branch

Hosting static site on BitBucket Similar steps for BitBucket (+ can have 5 private repos for free!)

http://www.techrepublic.com/article/host-static-websites-for-free-with-bitbuckets-git-feature/

Any source commit means immediate effective deployment too Simple and easy to use You have automatic source tracking

Hosting static site from Git repo Leverage features of Git repo sites (issue tracking, etc) You can register a custom domain name and set the CNAME for

the DNS record Favicon There’s NO database backend and NO application server (PHP,

Java, ASP.NET)! You can also leverage Google Drive, but you will only have

limited change tracking

Hosting static site from Git repo Leverage features of Git repo sites (issue tracking, etc) You can register a custom domain name and set the CNAME for

the DNS record Favicon There’s NO database backend and NO application server (PHP,

Java, ASP.NET)! You can also leverage Google Drive, but you will only have

limited change tracking

Special: personal website Another naming convention: when you name the repository like

“username.gtihub.io”, this signals to GitHub that you want to serve that repository as a static website when someone visits username.gtihub.io

In that special case the repository shouldn’t be in the gh-pages branch, but it has to be in the master branch

Static websites examples One extra, which uses Google Maps and Synfusion’s radial

context menus: https://mrcsabatoth.github.io/RottenApples/ https://github.com/MrCsabaToth/RottenApples

Thanks for listening Questions?

Csaba Toth Download: http://www.slideshare.net/tothc http://www.linkedin.com/in/csabatothdev

top related