Opening Webpage from GitHub Repo is Possible for Limited Usage, Development Purposes only – you Actually Can Render All CSS, Js, Images like in normal Server. Again – this is only if a repository do not have a corresponding Github page to give you a demo of what it can offer – definitely it will work only if there is a HTML file, usually index.html file.
Opening Webpage from GitHub Repo : Warning and Proper Usage
Opening Webpage from GitHub Repo in this way we are describing is only for temporary usage – there is GitHub pages – we basically described the proper way to get a GitHub Page for you – that is free too. If millions of calls comes to the same repo, even there is mechanism to check cache, GitHub obviously stop delivering the CSS and Js files and substitute them with evil.js and evil.css.
There are many website which writes to use GitHub as CDN – that is not right. In other words, my legit GitHub page is http://abhishekghosh.github.io/. Others we are showing, only for dev purpose, nothing more or less.
Opening Webpage from GitHub Repo : The Things
For example, this an example repository :
Take that, the developer has not created a HTML page – that is a GitHub page, its quite common. But the repo actually has a index.html file. We can fetch the content in two ways :
First way will show the source as Plain Text :
This is what we get when we click the proper button in embedded source code in case of Gist. So, the format is :
https://raw.github.com/<span style="color: #ff0000;">UserName</span>/<span style="color: #008000;">RepoName</span>/<span style="color: #0000ff;">branch</span>/index.html
Branch is usually master. But if we want to render it like a real webpage, we will use this one :
So, the thing is nothing different from the first example, except the domain name is becoming rawgithub.com instead of raw.github.com subdomain. We are not going in to the demo’s technical part – this is used only for this example. So, you have learned – Opening Webpage from GitHub Repo for Dev Purpose – but, please do not abuse it.