How to link files directly from Github (raw.github.com)

后端 未结 10 2299
耶瑟儿~
耶瑟儿~ 2020-11-30 19:52

Are we allowed to link files directly from Github ?



        
10条回答
  •  没有蜡笔的小新
    2020-11-30 20:41

    Use jsdelivr.com

    Copied directly from https://www.jsdelivr.com/?docs=gh:

    load any GitHub release, commit, or branch
    note: we recommend using npm for projects that support it

    https://cdn.jsdelivr.net/gh/user/repo@version/file

    load jQuery v3.2.1

    https://cdn.jsdelivr.net/gh/jquery/jquery@3.2.1/dist/jquery.min.js

    use a version range instead of a specific version

    https://cdn.jsdelivr.net/gh/jquery/jquery@3.2/dist/jquery.min.js

    https://cdn.jsdelivr.net/gh/jquery/jquery@3/dist/jquery.min.js

    omit the version completely to get the latest one

    you should NOT use this in production

    https://cdn.jsdelivr.net/gh/jquery/jquery/dist/jquery.min.js

    add ".min" to any JS/CSS file to get a minified version

    if one doesn't exist, we'll generate it for you

    https://cdn.jsdelivr.net/gh/jquery/jquery@3.2.1/src/core.min.js

    add / at the end to get a directory listing

    https://cdn.jsdelivr.net/gh/jquery/jquery/

提交回复
热议问题