Skip to content

Commit fd86fe3

Browse files
committed
first commit
0 parents  commit fd86fe3

16 files changed

+20200
-0
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Project dependencies
2+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
3+
node_modules
4+
.cache/
5+
# Build directory
6+
public/
7+
.DS_Store
8+
yarn-error.log

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 gatsbyjs
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# gatsby-starter-default
2+
The default Gatsby starter
3+
4+
For an overview of the project structure please refer to the [Gatsby documentation - Building with Components](https://www.gatsbyjs.org/docs/building-with-components/)
5+
6+
Install this starter (assuming Gatsby is installed) by running from your CLI:
7+
```
8+
gatsby new gatsby-example-site
9+
```
10+
11+
## Deploy
12+
13+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/gatsbyjs/gatsby-starter-default)

gatsby-config.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
siteMetadata: {
3+
title: `Gatsby Default Starter`
4+
},
5+
plugins: [
6+
'gatsby-plugin-react-helmet',
7+
`gatsby-plugin-styled-components`,
8+
`gatsby-plugin-sass`,
9+
{
10+
resolve: `gatsby-source-filesystem`,
11+
options: {
12+
path: `${__dirname}/src/pages`,
13+
name: 'pages'
14+
}
15+
},
16+
{
17+
resolve: 'gatsby-transformer-remark',
18+
options: {
19+
plugins: []
20+
}
21+
}
22+
]
23+
};

gatsby-node.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const path = require('path');
2+
3+
exports.createPages = ({ boundActionCreators, graphql }) => {
4+
const { createPage } = boundActionCreators;
5+
6+
const blogPostTemplate = path.resolve(`src/templates/blog-post.js`);
7+
8+
return graphql(`
9+
{
10+
allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }, limit: 1000) {
11+
edges {
12+
node {
13+
excerpt(pruneLength: 400)
14+
html
15+
id
16+
frontmatter {
17+
path
18+
date
19+
title
20+
}
21+
}
22+
}
23+
}
24+
}
25+
`).then(result => {
26+
if (result.errors) {
27+
return Promise.reject(result.errors);
28+
}
29+
result.data.allMarkdownRemark.edges.forEach(({ node }) => {
30+
createPage({
31+
path: node.frontmatter.path,
32+
component: blogPostTemplate,
33+
context: {} // additional data can be passed via context
34+
});
35+
});
36+
});
37+
};

0 commit comments

Comments
 (0)