如何直接从Github(raw.github.com)链接文件 [英] How to link files directly from Github (raw.github.com)
本文介绍了如何直接从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 Code允许这样做。这样,我不必担心更新本地文件。
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
好处:
- 让您链接到特定的提交,以及自动获取最新的(又名master)
- 高流量不会造成任何损害; RawGit要求仅在开发过程中使用dev.rawgit.com链接,因为GitCDN允许您访问最新版本,而没有服务器爆炸的危险
- 为您提供以下选择:自动缩小HTML,CSS和JavaScript或以书面形式提供( https://min.gitcdn.link )
- 添加压缩(GZip)
- 添加所有正确的标头(Content-Type,cache-control,e-tag等)
- Lets you link to specific commits, as well as auto-get the latest (aka master)
- Incurs no damage from high traffic volumes; RawGit asks that it's dev.rawgit.com links be only used during development, where as GitCDN give you access to the latest version, without the danger of the servers exploding
- Give you the option of auto minifying your HTML, CSS and JavaScript, or serving it as written (https://min.gitcdn.link).
- Adds compression (GZip)
- Adds all the correct headers (Content-Type, cache-control, e-tag, etc)
完整披露,我是 GitCDN.link
这篇关于如何直接从Github(raw.github.com)链接文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文