Skip to content

Commit 8e11fb2

Browse files
committed
scaffold gatsby app
1 parent c9911ba commit 8e11fb2

21 files changed

+12789
-42
lines changed

.gitignore

+14-40
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
2-
# Created by https://www.gitignore.io/api/node
3-
# Edit at https://www.gitignore.io/?templates=node
4-
5-
### Node ###
61
# Logs
72
logs
83
*.log
94
npm-debug.log*
105
yarn-debug.log*
116
yarn-error.log*
12-
lerna-debug.log*
13-
14-
# Diagnostic reports (https://nodejs.org/api/report.html)
15-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
167

178
# Runtime data
189
pids
@@ -25,12 +16,11 @@ lib-cov
2516

2617
# Coverage directory used by tools like istanbul
2718
coverage
28-
*.lcov
2919

3020
# nyc test coverage
3121
.nyc_output
3222

33-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
3424
.grunt
3525

3626
# Bower dependency directory (https://bower.io/)
@@ -39,19 +29,16 @@ bower_components
3929
# node-waf configuration
4030
.lock-wscript
4131

42-
# Compiled binary addons (https://nodejs.org/api/addons.html)
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
4333
build/Release
4434

4535
# Dependency directories
4636
node_modules/
4737
jspm_packages/
4838

49-
# TypeScript v1 declaration files
39+
# Typescript v1 declaration files
5040
typings/
5141

52-
# TypeScript cache
53-
*.tsbuildinfo
54-
5542
# Optional npm cache directory
5643
.npm
5744

@@ -64,32 +51,19 @@ typings/
6451
# Output of 'npm pack'
6552
*.tgz
6653

67-
# Yarn Integrity file
68-
.yarn-integrity
69-
7054
# dotenv environment variables file
7155
.env
72-
.env.test
7356

74-
# parcel-bundler cache (https://parceljs.org/)
75-
.cache
57+
# gatsby files
58+
.cache/
59+
public
7660

77-
# next.js build output
78-
.next
61+
# Mac files
62+
.DS_Store
7963

80-
# nuxt.js build output
81-
.nuxt
82-
83-
# vuepress build output
84-
.vuepress/dist
85-
86-
# Serverless directories
87-
.serverless/
88-
89-
# FuseBox cache
90-
.fusebox/
91-
92-
# DynamoDB Local files
93-
.dynamodb/
94-
95-
# End of https://www.gitignore.io/api/node
64+
# Yarn
65+
yarn-error.log
66+
.pnp/
67+
.pnp.js
68+
# Yarn Integrity file
69+
.yarn-integrity

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache
2+
package.json
3+
package-lock.json
4+
public

.prettierrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"endOfLine": "lf",
3+
"semi": false,
4+
"singleQuote": false,
5+
"tabWidth": 2,
6+
"trailingComma": "es5"
7+
}

gatsby-browser.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Implement Gatsby's Browser APIs in this file.
3+
*
4+
* See: https://www.gatsbyjs.org/docs/browser-apis/
5+
*/
6+
7+
// You can delete this file if you're not using it

gatsby-config.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
siteMetadata: {
3+
title: `Gatsby Default Starter`,
4+
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
5+
author: `@gatsbyjs`,
6+
},
7+
plugins: [
8+
`gatsby-plugin-react-helmet`,
9+
{
10+
resolve: `gatsby-source-filesystem`,
11+
options: {
12+
name: `images`,
13+
path: `${__dirname}/src/images`,
14+
},
15+
},
16+
`gatsby-transformer-sharp`,
17+
`gatsby-plugin-sharp`,
18+
{
19+
resolve: `gatsby-plugin-manifest`,
20+
options: {
21+
name: `gatsby-starter-default`,
22+
short_name: `starter`,
23+
start_url: `/`,
24+
background_color: `#663399`,
25+
theme_color: `#663399`,
26+
display: `minimal-ui`,
27+
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
28+
},
29+
},
30+
// this (optional) plugin enables Progressive Web App + Offline functionality
31+
// To learn more, visit: https://gatsby.dev/offline
32+
// `gatsby-plugin-offline`,
33+
],
34+
}

gatsby-node.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Implement Gatsby's Node APIs in this file.
3+
*
4+
* See: https://www.gatsbyjs.org/docs/node-apis/
5+
*/
6+
7+
// You can delete this file if you're not using it

gatsby-ssr.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
3+
*
4+
* See: https://www.gatsbyjs.org/docs/ssr-apis/
5+
*/
6+
7+
// You can delete this file if you're not using it

license

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MIT License
1+
The MIT License (MIT)
22

33
Copyright (c) 2019 John Sylvain
44

@@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22+

package.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "gatsby-starter-default",
3+
"private": true,
4+
"description": "A simple starter to get up and developing quickly with Gatsby",
5+
"version": "0.1.0",
6+
"author": "Kyle Mathews <[email protected]>",
7+
"dependencies": {
8+
"gatsby": "^2.13.73",
9+
"gatsby-image": "^2.2.10",
10+
"gatsby-plugin-manifest": "^2.2.6",
11+
"gatsby-plugin-offline": "^2.2.7",
12+
"gatsby-plugin-react-helmet": "^3.1.4",
13+
"gatsby-plugin-sharp": "^2.2.13",
14+
"gatsby-source-filesystem": "^2.1.11",
15+
"gatsby-transformer-sharp": "^2.2.7",
16+
"prop-types": "^15.7.2",
17+
"react": "^16.9.0",
18+
"react-dom": "^16.9.0",
19+
"react-helmet": "^5.2.1"
20+
},
21+
"devDependencies": {
22+
"prettier": "^1.18.2"
23+
},
24+
"keywords": [
25+
"gatsby"
26+
],
27+
"license": "MIT",
28+
"scripts": {
29+
"build": "gatsby build",
30+
"develop": "gatsby develop",
31+
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
32+
"start": "npm run develop",
33+
"serve": "gatsby serve",
34+
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing \""
35+
},
36+
"repository": {
37+
"type": "git",
38+
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
39+
},
40+
"bugs": {
41+
"url": "https://github.com/gatsbyjs/gatsby/issues"
42+
}
43+
}

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# staccato music blog
1+
# staccato

src/components/header.js

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { Link } from "gatsby"
2+
import PropTypes from "prop-types"
3+
import React from "react"
4+
5+
const Header = ({ siteTitle }) => (
6+
<header
7+
style={{
8+
background: `rebeccapurple`,
9+
marginBottom: `1.45rem`,
10+
}}
11+
>
12+
<div
13+
style={{
14+
margin: `0 auto`,
15+
maxWidth: 960,
16+
padding: `1.45rem 1.0875rem`,
17+
}}
18+
>
19+
<h1 style={{ margin: 0 }}>
20+
<Link
21+
to="/"
22+
style={{
23+
color: `white`,
24+
textDecoration: `none`,
25+
}}
26+
>
27+
{siteTitle}
28+
</Link>
29+
</h1>
30+
</div>
31+
</header>
32+
)
33+
34+
Header.propTypes = {
35+
siteTitle: PropTypes.string,
36+
}
37+
38+
Header.defaultProps = {
39+
siteTitle: ``,
40+
}
41+
42+
export default Header

src/components/image.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from "react"
2+
import { useStaticQuery, graphql } from "gatsby"
3+
import Img from "gatsby-image"
4+
5+
/*
6+
* This component is built using `gatsby-image` to automatically serve optimized
7+
* images with lazy loading and reduced file sizes. The image is loaded using a
8+
* `useStaticQuery`, which allows us to load the image from directly within this
9+
* component, rather than having to pass the image data down from pages.
10+
*
11+
* For more information, see the docs:
12+
* - `gatsby-image`: https://gatsby.dev/gatsby-image
13+
* - `useStaticQuery`: https://www.gatsbyjs.org/docs/use-static-query/
14+
*/
15+
16+
const Image = () => {
17+
const data = useStaticQuery(graphql`
18+
query {
19+
placeholderImage: file(relativePath: { eq: "gatsby-astronaut.png" }) {
20+
childImageSharp {
21+
fluid(maxWidth: 300) {
22+
...GatsbyImageSharpFluid
23+
}
24+
}
25+
}
26+
}
27+
`)
28+
29+
return <Img fluid={data.placeholderImage.childImageSharp.fluid} />
30+
}
31+
32+
export default Image

0 commit comments

Comments
 (0)