Github编辑而不更改URL [英] Github gist editing without changing URL

查看:132
本文介绍了Github编辑而不更改URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在脚本标记中有一些javascript代码,如下所示:

I have a gist with some javascript code in a script tag, like so:

<script src="https://raw.github.com/gist/b25dff23c2c4b4bd425a/f157aa95163311c4b58febb06b49ffd16419f642/images.js"></script>

我需要继续在github上编辑JS文件。但是,当您编辑要点时,它会更改要点的URL。如何保留相同的URL?

And I will need to keep editing the JS file on github. However, when you edit a gist it changes the URL of the gist. How do I keep the same URL?

推荐答案

Gist更改了此文件模式的路径:

Gist changed the path to this file pattern:

https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_REVISION_ID>/<GIST_FILE_NAME>

您会注意到现在最佳答案的链接是404'。

You will notice that now the top answers' links are 404'ing.

只需应用这个新模式并vo!

Simply apply this new pattern and voilà!

https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_FILE_NAME>

例如:

https://gist.githubusercontent.com/wesbos/cd16b8b1815825f111a2/raw/lol.js

这篇关于Github编辑而不更改URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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