如何直接从 Github (raw.github.com) 链接文件 [英] How to link files directly from Github (raw.github.com)

查看:148
本文介绍了如何直接从 Github (raw.github.com) 链接文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是否允许直接从 Github 链接文件?

Are we allowed to link files directly from Github ?

<link rel="stylesheet" href="https://raw.github.com/username/project/master/style.css"/>
<script src="https://raw.github.com/username/project/master/script.js"></script>

我知道这在 Google 代码中是允许的.这样我就不用担心更新本地文件了.

I know this is allowed on Google Code. This way I don't have to worry about updating a local file.

推荐答案

已经提到了 RawGit 的伟大服务,但我会再提一个:GitCDN.link

The great service RawGit was already mentioned, but I'll throw another into the ring: GitCDN.link

优点:

  • 让您链接到特定的提交,以及自动获取最新的(又名主)
  • 不会因高流量而造成损害;RawGit 要求它的 dev.rawgit.com 链接仅在开发过程中使用,而 GitCDN 让您可以访问最新版本,而不会出现服务器爆炸的危险
  • 为您提供自动缩小 HTML、CSS 和 JavaScript 的选项,或按书面形式提供 (https://min.gitcdn.link).
  • 添加压缩 (GZip)
  • 添加所有正确的标头(内容类型、缓存控制、电子标签等)

完全公开,我是 GitCDN.link

这篇关于如何直接从 Github (raw.github.com) 链接文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆