/
index.js
232 lines (225 loc) · 8.15 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
import React from "react"
import Link from "gatsby-link"
import presets from "../utils/presets"
import colors from "../utils/colors"
import { rhythm, scale, options } from "../utils/typography"
import { JSIcon, WebpackIcon, ReactJSIcon, GraphQLIcon } from "../assets/logos"
import { vP, vPHd, vPVHd, vPVVHd } from "../components/gutters"
import Container from "../components/container"
import MastheadContent from "../components/masthead"
import MastheadBg from "../components/masthead-bg"
import UsedBy from "../components/used-by"
import Cards from "../components/cards"
import Card from "../components/card"
import CardHeadline from "../components/card-headline"
import Diagram from "../components/diagram"
import BlogPostPreviewItem from "../components/blog-post-preview-item"
import FuturaParagraph from "../components/futura-paragraph"
import CtaButton from "../components/cta-button"
import TechWithIcon from "../components/tech-with-icon"
const IndexRoute = React.createClass({
render() {
console.log(this.props)
const blogPosts = this.props.data.allMarkdownRemark
return (
<div css={{ position: `relative` }}>
<div
css={{
background: presets.brand,
position: `absolute`,
bottom: `0`,
top: `0`,
left: `0`,
right: `0`,
height: `100%`,
zIndex: -1,
}}
/>
<MastheadBg />
<div
css={{
display: `flex`,
flexDirection: `row`,
flexWrap: `wrap`,
justifyContent: `space-between`,
}}
>
<MastheadContent />
<UsedBy />
<div
css={{
padding: rhythm(presets.gutters.default / 2),
flex: `0 0 100%`,
[presets.Hd]: {
padding: vP,
paddingTop: 0,
},
}}
>
<Cards>
<Card>
<CardHeadline>
Modern web tech without the headache
</CardHeadline>
<FuturaParagraph>
Enjoy the power of the latest web technologies –{` `}
<TechWithIcon icon={ReactJSIcon}>React.js</TechWithIcon>,{` `}
<TechWithIcon icon={WebpackIcon}>Webpack</TechWithIcon>,{` `}
modern JavaScript and CSS and more — all setup and waiting for
you to start building.
</FuturaParagraph>
</Card>
<Card>
<CardHeadline>Bring your own data</CardHeadline>
<FuturaParagraph>
Gatsby’s rich data plugin ecosystem lets you build sites with
the data you want — from one or many sources: Pull data from
headless CMSs, SaaS services, APIs, databases, your file
system & more directly into your pages using{` `}
<TechWithIcon icon={GraphQLIcon}>GraphQL</TechWithIcon>.
</FuturaParagraph>
</Card>
<Card>
<CardHeadline>Scale to the entire internet</CardHeadline>
<FuturaParagraph>
Gatsby.js is Internet Scale. Forget complicated deploys with
databases and servers and their expensive, time-consuming
setup costs, maintenance, and scaling fears. Gatsby.js builds
your site as “static” files which can be deployed easily on
dozens of services.
</FuturaParagraph>
</Card>
<Card>
<CardHeadline css={{ color: presets.brandDark }}>
Future-proof your website
</CardHeadline>
<FuturaParagraph>
Don't build a website with last decade's tech. The future of
the web is mobile, JavaScript and APIs—the {` `}
<a href="https://jamstack.org/">JAMstack</a>. Every website is
a web app and every web app is a website. Gatsby.js is the
universal JavaScript framework you’ve been waiting for.
</FuturaParagraph>
</Card>
<Card>
<CardHeadline>
<em css={{ color: presets.brand, fontStyle: `normal` }}>
Static
</em>
{` `}
Progressive Web Apps
</CardHeadline>
<FuturaParagraph>
Gatsby.js is a static PWA (Progressive Web App) generator. You
get code and data splitting out-of-the-box. Gatsby loads only
the critical HTML, CSS, data, and JavaScript so your site
loads as fast as possible. Once loaded, Gatsby prefetches
resources for other pages so clicking around the site feels
incredibly fast.
</FuturaParagraph>
</Card>
<Card>
<CardHeadline>Speed past the competition</CardHeadline>
<FuturaParagraph>
Gatsby.js builds the fastest possible website. Instead of
waiting to generate pages when requested, pre-build pages and
lift them into a global cloud of servers — ready to be
delivered instantly to your users wherever they are.
</FuturaParagraph>
</Card>
<Diagram
containerCSS={{
borderTopLeftRadius: 0,
borderTopRightRadius: 0,
flex: `1 1 100%`,
borderTop: `1px solid ${presets.veryLightPurple}`,
}}
/>
<div css={{ flex: `1 1 100%` }}>
<Container hasSideBar={false}>
<div
css={{
textAlign: `center`,
padding: `${rhythm(1)} 0 ${rhythm(2)}`,
}}
>
<h1 css={{ marginTop: 0 }}>Curious yet?</h1>
<FuturaParagraph>
It only takes a few minutes to get up and running!
</FuturaParagraph>
<CtaButton to="/docs/" overrideCSS={{ marginTop: `1rem` }}>
Get Started
</CtaButton>
</div>
</Container>
</div>
<div
css={{
borderTop: `1px solid ${presets.veryLightPurple}`,
flex: `1 1 100%`,
[presets.Tablet]: {
paddingTop: rhythm(1),
},
}}
>
<Container
hasSideBar={false}
css={{ maxWidth: rhythm(30), paddingBottom: `0 !important` }}
>
<h2
css={{
textAlign: `left`,
marginTop: 0,
color: presets.brand,
[presets.Tablet]: {
paddingBottom: rhythm(1),
},
}}
>
Latest from the Gatsby blog
</h2>
{blogPosts.edges.map(({ node }) =>
<BlogPostPreviewItem post={node} key={node.fields.slug} />
)}
</Container>
</div>
</Cards>
</div>
</div>
</div>
)
},
})
export default IndexRoute
export const pageQuery = graphql`
query Index {
site {
siteMetadata {
title
}
}
file(relativePath: { eq: "gatsby-explanation.png" }) {
childImageSharp {
responsiveSizes(maxWidth: 870) {
src
srcSet
sizes
}
}
}
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 3
filter: {
frontmatter: { draft: { ne: true } }
fileAbsolutePath: { regex: "/blog/" }
}
) {
edges {
node {
...BlogPostPreview_item
}
}
}
}
`