I\'ve got a repository on github with a .css file in it. Is there any way to have github serve this file in a way that I can consume it in a web page?
In other words
Check out https://gitcdn.link/ . Seems to work well.
Rawgit.com has shut down.
Important: rawgit.com is shutting down. Read more about other alternatives here - https://rawgit.com/
Found something really cool. You get the raw link as: http://raw.github.com/...
Simply fetch the files from rawgit.com (or cdn.rawgit.com
) instead of raw.github.com
and DONE!
UPDATE:
You can also use raw.githack.com if you want to serves raw files directly from Bitbucket or GitLab
GitHub repos aren't web hosting, you should push that stuff up to a service specifically designed to serve files, like pages.github.com.
You have to use RawGit which, is a part of MaxCDN, serve files directly from the GitHub repository with the correct content type header. Full tutorial, click here
- First Visit RawGit as suggested earlier
- Next copy your file path from github into the RawGit box
- RawGit will automatically produce two refrences to your web page
- The Development and Production refrence
- refrence the development link in your webpage if you are still developing
- save/upload then reload your webpage
- if there was no change it means your browser has saved your former refrence
- clear your browser data then reload
- Hope that helps?