Your FREE website

on GitHub

Tony Su

KPLUG

December 12, 2019

What is Github?

Free for public use, cost for private use

Today, owned by Microsoft

Utilizes Git as its versioning file system

Primarily used by Developers

Original concept innovatively combines code repository with social media access

Will serve static websites for free!

Overview

  • Github create a brand new website
  • Github modify and existing website
  • wget scrape a website
  • HTTrack scrap a website

Topics to be covered

Create a brand new website

  • Sign up, create an account on www.github.com
    Login to test
  • Install necessary and desired tools, components

Following is openSUSE, but use whatever package manager for your own distro

zypper in git mlocate tree lxterminall httrack
  • Set up git client global properties
git config --global user.email "you@example.com"
git config --global user.name "Github Username"

Create a brand new website 

  • Create a new repository on www.github.com/username
  • Clone the website to your local machine
git clone [repository URL]
  • Create a gh-pages branch
git checkout --orphan gh-pages
  • Remove local files (You will likely have at least a README.md file from the Main branch)

Page 2

git rm -rf .
  • Create or paste some content

Create a brand new website 

  • Create a new repository on www.github.com/username
  • Upload and set target to gh-pages (required only once unless and until switch to another branch)
git push --set-upstream origin gh-pages

Page 3

Modify an existing website 

  • Fork the website
  • Clone a local working instance of your forked copy
git clone [repo url]
  • If your website was cloned awhile ago, update your local repo
git update
  • If you don't see website files, you may need to change to the gh-pages branch
git checkout gh-pages
  • Make your changes.

Uploading

  • Stage your updated changes for uploading
  • The following actually uploads. 
git add .
  • Commit your changes and create an annotation so people will know what these changes are without inspecting your code directly
git commit -am "A comment"
git push
  • If for some reason the above complains about the branch, then

Unless you configured SSH or multi-factor authentication, you will be prompted for your Password (and maybe your Username if the global setting didn't take)

git push origin gh-pages

Uploading

  • Check your handiwork.
http://kplug-sd.github.io/website/

Currently, for the KPLUG "website" repository, the URL is

Page 2

Website scraping

  • Wget
wget --recursive --level=5 --convert-links --page-requisites --domains=kernel-panic.org
--no-parent http://www.kernel-panic.org

Scraping can also mean extracting content from a web page. Today we are simply doing web duplication, but also in a way that translates links so that the website can be read without a webserver.

  • HTTrack

Some Additional Info

Questions?

Made with Slides.com