Skip to content

Latest commit

 

History

History
72 lines (40 loc) · 1.89 KB

README.md

File metadata and controls

72 lines (40 loc) · 1.89 KB

Description

GITHUB CDN

This projects helps to incoperate github as a CDN

You can also use Jsdelivr but using jsdelivr, your file gotten from the cdn is not always updated when you update your corresponding github repo

How to use

1. Create a script tag at the begin of your document 
        <script>
        
        </script>

2. In that script tag define a variable called githubcdn to a list
        <script>
        let githubcdn = []
        
        </script>
3. In that list enumerate all the github repo files you would love to import . using the format below
                _MaverickDe/acetoolscms/main/kwikertools.js
                [github user name]/[github repo name]/[branch]/[path to file]
                 
                real example will be:
                [MaverickDe]/[acetoolscms]/[main]/[kwikertools.js]
            ==>>MaverickDe/acetoolscms/main/kwikertools.js


              <script>
                let githubcdn = [MaverickDe/acetoolscms/main/kwikertools.js]
        
              </script>
4. create a new script tag also where you would love to import your repo and assign it  an id using the format below

            <script id="githubcdn_[github user name]/[github repo name]/[branch]/[path to file]"></script>

            real example below
            <script id="githubcdn__MaverickDe/acetoolscms/main/kwikertools.js"></script>

5. Assign a src attribute to the script tag with a src attribute using the url below

                https://cdn.jsdelivr.net/gh/MaverickDe/GITHUBCDN@main/githubcdn.js

            


Screenshot 2022-12-15 024531

Note

Using this method your CDN file is always goung to update when you update your corresponding repo files


## Developer
```bash
ASOTIBE PRINCEWILL ONYEMAECHI
princewillasotibe123@gmail.com