Skip to content

Commit 6931892

Browse files
committed
polish, missing links, documentation
1 parent 21b467f commit 6931892

File tree

8 files changed

+87
-70
lines changed

8 files changed

+87
-70
lines changed

resources/Site.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ async function readSite(siteRoot) {
4040
});
4141
});
4242

43+
// Cross-link all prev/next pages
44+
var pageByUrl = Object.create(null);
45+
for (var i = 0; i < site.files.length; i++) {
46+
pageByUrl[path.resolve(site.files[i].url)] = site.files[i];
47+
}
48+
49+
for (var i = 0; i < site.files.length; i++) {
50+
var page = site.files[i];
51+
if (page.next) {
52+
page.nextPage = pageByUrl[path.resolve(page.url, page.next)];
53+
}
54+
}
55+
4356
return site;
4457
}
4558

site/_core/DocsLayout.js

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,20 @@ var Site = require('./Site');
1212
var Marked = require('./Marked');
1313
var DocsSidebar = require('./DocsSidebar');
1414

15-
var DocsLayout = React.createClass({
16-
render: function() {
17-
var page = this.props.page;
18-
var site = this.props.site;
19-
20-
return (
21-
<Site section="docs" title={page.title}>
22-
<section>
23-
<div className="documentationContent">
24-
<div className="inner-content">
25-
<h1>{page.title}</h1>
26-
<Marked>{page.content}</Marked>
27-
<div className="docs-prevnext">
28-
{page.previous && <a className="docs-prev" href={path.resolve(page.url, page.previous)}>&larr; Prev</a>}
29-
{page.next && <a className="docs-next" href={path.resolve(page.url, page.next)}>Next &rarr;</a>}
30-
</div>
31-
</div>
32-
<DocsSidebar site={site} page={page} />
33-
</div>
34-
</section>
35-
</Site>
36-
);
37-
}
38-
});
39-
40-
module.exports = DocsLayout;
15+
export default ({ page, site }) =>
16+
<Site section="docs" title={page.title}>
17+
<section>
18+
<div className="documentationContent">
19+
<div className="inner-content">
20+
<h1>{page.title}</h1>
21+
<Marked>{page.content}</Marked>
22+
{page.next &&
23+
<a className="read-next" href={path.resolve(page.url, page.next)}>
24+
<span className="read-next-continue">Continue Reading &rarr;</span>
25+
<span className="read-next-title">{page.nextPage.title}</span>
26+
</a>}
27+
</div>
28+
<DocsSidebar site={site} page={page} />
29+
</div>
30+
</section>
31+
</Site>

site/_core/GraphQLJSLayout.js

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,20 @@ var Site = require('./Site');
1212
var Marked = require('./Marked');
1313
var DocsSidebar = require('./DocsSidebar');
1414

15-
var GraphQLJSLayout = React.createClass({
16-
render: function() {
17-
var page = this.props.page;
18-
var site = this.props.site;
19-
return (
20-
<Site title={page.title} category="GraphQL.js">
21-
<section>
22-
<div className="documentationContent">
23-
<div className="inner-content">
24-
<h1>{page.title}</h1>
25-
<Marked>{page.content}</Marked>
26-
<div className="docs-prevnext">
27-
{page.previous && <a className="docs-prev" href={path.resolve(page.url, page.previous)}>&larr; Prev</a>}
28-
{page.next && <a className="docs-next" href={path.resolve(page.url, page.next)}>Next &rarr;</a>}
29-
</div>
30-
</div>
31-
<DocsSidebar site={site} page={page} />
32-
</div>
33-
</section>
34-
</Site>
35-
);
36-
}
37-
});
38-
39-
module.exports = GraphQLJSLayout;
15+
export default ({ page, site }) =>
16+
<Site title={page.title} category="GraphQL.js">
17+
<section>
18+
<div className="documentationContent">
19+
<div className="inner-content">
20+
<h1>{page.title}</h1>
21+
<Marked>{page.content}</Marked>
22+
{page.next &&
23+
<a className="read-next" href={path.resolve(page.url, page.next)}>
24+
<span className="read-next-continue">Continue Reading &rarr;</span>
25+
<span className="read-next-title">{page.nextPage.title}</span>
26+
</a>}
27+
</div>
28+
<DocsSidebar site={site} page={page} />
29+
</div>
30+
</section>
31+
</Site>

site/_core/Site.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ var Site = React.createClass({
6363
</div>
6464
<div>
6565
<h5><a href="/code">Code</a></h5>
66-
<a>Servers</a>
67-
<a>Clients</a>
68-
<a>Tools</a>
66+
<a href="/code/#graphql-server-libraries">Servers</a>
67+
<a href="/code/#graphql-clients">Clients</a>
68+
<a href="/code/#tools">Tools</a>
6969
</div>
7070
<div>
7171
<h5><a href="/community">Community</a></h5>
72-
<a>Upcoming Events</a>
73-
<a>Conference Talks</a>
72+
<a href="/community/upcoming-events/">Upcoming Events</a>
73+
<a href="/community/#videos">Conference Talks</a>
7474
<a href="http://stackoverflow.com/questions/tagged/graphql" target="_blank">Stack Overflow</a>
7575
<a href="https://twitter.com/GraphQL" target="_blank">Twitter</a>
7676
</div>

site/_css/docs.less

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,35 @@
9292
}
9393
}
9494

95-
.docs-prevnext {
96-
padding-top: 40px;
97-
padding-bottom: 40px;
95+
.read-next {
96+
display: inline-block;
97+
margin: 4em -1em 0;
9898

99-
.docs-prev {
100-
float: left;
99+
@media screen and (max-width: 1119px) {
100+
margin-left: 0;
101101
}
102102

103-
.docs-next {
104-
float: right;
103+
border-radius: 3px;
104+
box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
105+
padding: 0.7em 1.5em 0.5em 1em;
106+
107+
&:hover, &:focus, &:active {
108+
background: @rhodamine-color;
109+
text-decoration: none;
110+
111+
.read-next-continue, .read-next-title {
112+
color: white;
113+
}
114+
}
115+
116+
.read-next-continue {
117+
.body-font(@size: 13px, @color: @rhodamine-color);
118+
display: block;
119+
}
120+
121+
.read-next-title {
122+
.body-font(@size: 26px, @color: @text-color);
123+
display: block;
105124
}
106125
}
107126

site/code/index.html.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ var Code = React.createClass({
1717
return (
1818
<Site section="code" title="Code">
1919

20-
<section className="content documentationContent nosidebar">
21-
<div className="inner-content">
22-
<h1>Code</h1>
23-
<Marked>{`
20+
<section>
21+
<div className="documentationContent">
22+
<div className="inner-content">
23+
<h1>Code</h1>
24+
<Marked>{`
2425
2526
Many different programming languages support GraphQL. This list contains some of the more popular server-side frameworks, client libraries, and other useful stuff.
2627
@@ -50,8 +51,9 @@ Many different programming languages support GraphQL. This list contains some of
5051
5152
- [awesome-graphql](https://github.com/chentsulin/awesome-graphql): A fantastic community maintained collection of libraries, resources, and more.
5253
53-
`}</Marked>
54+
`}</Marked>
5455

56+
</div>
5557
</div>
5658
</section>
5759

site/community/Community-Resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Developers inside and outside of Facebook have given talks about GraphQL at conf
5353
- [GraphQL Servers](https://www.youtube.com/watch?v=KOudxKJXsjc) - Nick Schrock, React Rally 2015
5454
- [GraphQL at Facebook](https://www.youtube.com/watch?v=etax3aEe2dA) - Dan Schafer, React Europe 2016
5555
- [GraphQL Source Code Overview](https://www.youtube.com/watch?v=IqtYr6RX32Q) - Lee Byron
56-
- [GraphQL Future](https://www.youtube.com/watch?v=ViXL0YQnioU) - Lee Byron & Laney Keunzel
56+
- [GraphQL Future](https://www.youtube.com/watch?v=ViXL0YQnioU) - Lee Byron & Laney Kuenzel
5757
- [Apollo Client: Put GraphQL Data in Your UI](https://www.youtube.com/watch?v=u1E0CbGeICo) - Sashko Stubailo
5858
- [Placeholder for Greg's React Rally Talk on Relay 2]
5959
- [Build a GraphQL server for Node.js, using PostgreSQL/MySQL](https://www.youtube.com/watch?v=DNPVqK_woRQ) - Lee Benson

site/index.html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ var index = React.createClass({
134134
"hero": {
135135
"name": "Luke Skywalker",
136136
"height": 1.72,
137-
"mass": "mass"
137+
"mass": 77
138138
}
139139
}`}
140140
</Prism>

0 commit comments

Comments
 (0)