Skip to main content

Posts

Showing posts with the label Static Hosting

How to turn any GitHub repo into a CDN Using jsDeliver

How to turn any GitHub repo into a CDN Last week I discovered  jsDeliver , a service that let’s you turn any GitHub repository into a CDN. Example :- https://cdn.jsdelivr.net/gh/SH20RAJ/BlondBtun@latest/blondbtun.css Recommendation :- Always Use @latest in URL to get the latest version and file. ( Hat tip to  Sarah Dayan, aka Frontstuff , for this one. ) Here’s how it works. The base URL is  https://cdn.jsdelivr.net/gh/{username}/{repo}/ , where you replace  {username}  with the GitHub username and  {repo}  with the repository name for the project. Append that URL with the path to the file you want to access in the project. For example, for my  Atomic XHR plugin , the JavaScript file is located in the  /dist  directory. You’d use this.  html <script src="https://cdn.jsdelivr.net/gh/cferdinandi/atomic/dist/atomic.js"></script> You can also take advantage of semantic versioning by adding  @{version-number}  ...

Publish Your Static Website with Repl.it

Repl.it Learn More

Random Posts