Skip to content

Commit f18cb07

Browse files
committed
Merge pull request github#436 from github/add-pages-api
Add documentation for the Pages API
2 parents 843b4fb + c1a7aec commit f18cb07

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

content/v3/repos/pages.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Pages | GitHub API
3+
---
4+
5+
# Pages
6+
7+
The Pages API retrieves information about your GitHub Pages configuration, and
8+
the statuses of your builds. Information about the site and the builds can only be
9+
accessed by authenticated owners, even thought the websites are public.
10+
11+
* TOC
12+
{:toc}
13+
14+
## Get information about a Pages site
15+
16+
GET /repos/:owner/:repo/pages
17+
18+
### Response
19+
20+
<%= headers 200 %>
21+
<%= json(:pages) %>
22+
23+
## List Pages builds
24+
25+
GET /repos/:owner/:repo/pages/builds
26+
27+
<%= headers 200 %>
28+
<%= json(:pages_build) { |h| [h] } %>
29+
30+
## List latest Pages build
31+
32+
GET /repos/:owner/:repo/pages/builds/latest
33+
34+
<%= headers 200 %>
35+
<%= json(:pages_build) %>

layouts/sidebar.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ <h3><a href="#" class="js-expand-btn collapsed arrow-btn" data-proofer-ignore></
8484
<li><a href="/v3/repos/forks/">Forks</a></li>
8585
<li><a href="/v3/repos/hooks/">Hooks</a></li>
8686
<li><a href="/v3/repos/merging/">Merging</a></li>
87+
<li><a href="/v3/repos/pages/">Pages</a></li>
8788
<li><a href="/v3/repos/releases/">Releases</a></li>
8889
<li><a href="/v3/repos/statistics/">Statistics</a></li>
8990
<li><a href="/v3/repos/statuses/">Statuses</a></li>

lib/resources.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,26 @@ def text_html(response, status, head = {})
631631
"s3_url" => "https://github.s3.amazonaws.com/"
632632
})
633633

634+
PAGES = {
635+
"url" => "https://api.github.com/repos/github/developer.github.com/pages",
636+
"status" => "built",
637+
"cname" => "developer.github.com",
638+
"custom_404" => false
639+
}
640+
641+
PAGES_BUILD = {
642+
"url" => "https://api.github.com/repos/github/developer.github.com/pages/builds/5472601",
643+
"status" => "built",
644+
"error" => {
645+
"message" => nil
646+
},
647+
"pusher" => USER,
648+
"commit" => "351391cdcb88ffae71ec3028c91f375a8036a26b",
649+
"duration" => 2104,
650+
"created_at" => "2014-02-10T19:00:49Z",
651+
"updated_at" => "2014-02-10T19:00:51Z"
652+
}
653+
634654
ORG = {
635655
"login" => "github",
636656
"id" => 1,

static/search-index.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@
240240
"title": "Merging",
241241
"section": "API/Repositories"
242242
},
243+
{
244+
"url": "/v3/repos/pages/",
245+
"title": "Pages",
246+
"section": "API/Repositories"
247+
},
243248
{
244249
"url": "/v3/repos/releases/",
245250
"title": "Releases",

0 commit comments

Comments
 (0)