我讀a blog post描述如何訪問GitHub的內部原始內容:如何訪問GitHub wiki頁面的原始降價文檔在哪裏?
這並不完全是顯而易見的(至少這不是對我來說),但維基因爲 Github上通過適當的Git支持實際回報,我想它 應該可以通過使用 Github的https://raw.github.com/樣式URL訪問頁面的原始降價。
一些小的試驗/錯誤後,它原來是很容易預測(如在 GitHub的很多東西):
https://raw.github.com/wiki/[user]/[project]/[page].md
我有一個回購mbigras/hello-world與mbigras/hello-world/wiki/foobar維基頁面。因此,根據按照上述模式應該工作:
https://raw.github.com/wiki/mbigras/hello-world/foobar.md
好像GitHub上已經改變了它的路由,如下圖所示:
$ curl https://raw.github.com/wiki/mbigras/hello-world/foobar.md
$ curl -Is https://raw.github.com/wiki/mbigras/hello-world/foobar.md 2>&1 | head -n 2
HTTP/1.1 301 Moved Permanently
Location: https://raw.githubusercontent.com/wiki/mbigras/hello-world/foobar.md
$ curl -L https://raw.github.com/wiki/mbigras/hello-world/foobar.md
{
"foo": "bar",
"cat": "dog",
"red": "hat"
}
因此,新的模式似乎是:
https://raw.githubusercontent.com/wiki/[user]/[project]/[page].md
- GitHub會發布有關如何訪問wiki頁面的原始降價源的文檔嗎?
這似乎並不工作了 - 2018年2月 – Federico