-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ee26c54
Showing
23 changed files
with
442 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
}, | ||
"plugins": [ | ||
"react", | ||
], | ||
"globals": { | ||
"graphql": false, | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"experimentalObjectRestSpread": true, | ||
"jsx": true, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules/ | ||
public | ||
.gatsby-context.js | ||
.DS_Store | ||
.intermediate-representation/ | ||
.cache/ | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"semi": false, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: node_js | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
node_js: | ||
- "node" | ||
- "lts/*" | ||
- "7" | ||
- "8" | ||
|
||
script: | ||
- npm install | ||
- npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 Georgi Yanev | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# fpvtips.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
module.exports = { | ||
siteMetadata: { | ||
title: 'Fpvtips', | ||
author: 'Georgi Yanev', | ||
description: 'Fpvtips.com', | ||
siteUrl: 'https://fpvtips.com/', | ||
}, | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
path: `${__dirname}/src/pages`, | ||
name: 'pages', | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-transformer-remark`, | ||
options: { | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-remark-images`, | ||
options: { | ||
maxWidth: 590, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-remark-responsive-iframe`, | ||
options: { | ||
wrapperStyle: `margin-bottom: 1.0725rem`, | ||
}, | ||
}, | ||
'gatsby-remark-prismjs', | ||
'gatsby-remark-copy-linked-files', | ||
'gatsby-remark-smartypants', | ||
], | ||
}, | ||
}, | ||
`gatsby-transformer-sharp`, | ||
`gatsby-plugin-sharp`, | ||
{ | ||
resolve: `gatsby-plugin-google-analytics`, | ||
options: { | ||
//trackingId: `ADD YOUR TRACKING ID HERE`, | ||
}, | ||
}, | ||
`gatsby-plugin-feed`, | ||
{ | ||
resolve: `gatsby-plugin-manifest`, | ||
options: { | ||
name: `fpvtips.com`, | ||
short_name: `FPVtips`, | ||
start_url: `/`, | ||
background_color: `#ffffff`, | ||
theme_color: `#1960a0`, | ||
display: `minimal-ui`, | ||
icon: `src/assets/fpvtips-logo-512.png`, | ||
}, | ||
}, | ||
`gatsby-plugin-offline`, | ||
`gatsby-plugin-react-helmet`, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const Promise = require('bluebird') | ||
const path = require('path') | ||
const { createFilePath } = require('gatsby-source-filesystem') | ||
|
||
exports.createPages = ({ graphql, actions }) => { | ||
const { createPage } = actions | ||
|
||
return new Promise((resolve, reject) => { | ||
const blogPost = path.resolve('./src/templates/blog-post.js') | ||
resolve( | ||
graphql( | ||
` | ||
{ | ||
allMarkdownRemark( | ||
sort: { fields: [frontmatter___date], order: DESC } | ||
limit: 1000 | ||
) { | ||
edges { | ||
node { | ||
fields { | ||
slug | ||
} | ||
frontmatter { | ||
title | ||
} | ||
} | ||
} | ||
} | ||
} | ||
` | ||
).then(result => { | ||
if (result.errors) { | ||
console.log(result.errors) | ||
reject(result.errors) | ||
} | ||
|
||
// Create blog posts pages. | ||
const posts = result.data.allMarkdownRemark.edges | ||
|
||
posts.forEach((post, index) => { | ||
const previous = | ||
index === posts.length - 1 ? null : posts[index + 1].node | ||
const next = index === 0 ? null : posts[index - 1].node | ||
|
||
createPage({ | ||
path: post.node.fields.slug, | ||
component: blogPost, | ||
context: { | ||
slug: post.node.fields.slug, | ||
previous, | ||
next, | ||
}, | ||
}) | ||
}) | ||
}) | ||
) | ||
}) | ||
} | ||
|
||
exports.onCreateNode = ({ node, actions, getNode }) => { | ||
const { createNodeField } = actions | ||
|
||
if (node.internal.type === `MarkdownRemark`) { | ||
const value = createFilePath({ node, getNode }) | ||
createNodeField({ | ||
name: `slug`, | ||
node, | ||
value, | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "fpvtips", | ||
"description": "fpvtips.com", | ||
"version": "1.0.0", | ||
"author": "Georgi Yanev <georgiyanev.gy@gmail.com>", | ||
"dependencies": { | ||
"gatsby": "next", | ||
"gatsby-plugin-feed": "next", | ||
"gatsby-plugin-google-analytics": "next", | ||
"gatsby-plugin-manifest": "next", | ||
"gatsby-plugin-offline": "next", | ||
"gatsby-plugin-react-helmet": "next", | ||
"gatsby-plugin-sharp": "next", | ||
"gatsby-remark-copy-linked-files": "next", | ||
"gatsby-remark-images": "next", | ||
"gatsby-remark-prismjs": "next", | ||
"gatsby-remark-responsive-iframe": "next", | ||
"gatsby-remark-smartypants": "next", | ||
"gatsby-source-filesystem": "next", | ||
"gatsby-transformer-remark": "next", | ||
"gatsby-transformer-sharp": "next", | ||
"prismjs": "^1.15.0", | ||
"react": "^16.3.2", | ||
"react-dom": "^16.3.2", | ||
"react-helmet": "^5.2.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.19.1", | ||
"eslint-plugin-react": "^7.7.0", | ||
"prettier": "^1.12.0" | ||
}, | ||
"keywords": [ | ||
"fpvtips" | ||
], | ||
"license": "MIT", | ||
"main": "n/a", | ||
"scripts": { | ||
"clean": "rm -rf .cache && rm -rf public/", | ||
"predev": "npm run clean", | ||
"dev": "gatsby develop", | ||
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js' 'src/**/*.md'", | ||
"develop": "gatsby develop", | ||
"build": "gatsby build", | ||
"fix-semi": "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.js" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import { StaticQuery, graphql } from 'gatsby' | ||
|
||
import './layout.css' | ||
|
||
const Layout = ({ children }) => ( | ||
<StaticQuery | ||
query={graphql` | ||
query SiteTitle { | ||
site { | ||
siteMetadata { | ||
title | ||
description | ||
} | ||
} | ||
} | ||
`} | ||
render={data => <React.Fragment>{children}</React.Fragment>} | ||
/> | ||
) | ||
|
||
export default Layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
|
||
const NotFoundPage = () => ( | ||
<div> | ||
<h1>NOT FOUND</h1> | ||
<p>You just hit a route that doesn't exist... the sadness.</p> | ||
</div> | ||
) | ||
|
||
export default NotFoundPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: My first post | ||
date: '2018-05-01T22:12:03.284Z' | ||
--- | ||
|
||
This is my first post! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: My Second Post | ||
date: '2015-05-06T23:46:37.121Z' | ||
--- | ||
|
||
Example content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react' | ||
|
||
const DictionaryPage = () => ( | ||
<div> | ||
<h1>DictionaryPage</h1> | ||
</div> | ||
) | ||
|
||
export default DictionaryPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react' | ||
|
||
const FPVSpotsPage = () => ( | ||
<div> | ||
<h1>FPV Spots Page</h1> | ||
</div> | ||
) | ||
|
||
export default FPVSpotsPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from 'react' | ||
import { Link, graphql } from 'gatsby' | ||
import Helmet from 'react-helmet' | ||
|
||
import Layout from '../components/Layout/layout' | ||
|
||
class IndexPage extends React.Component { | ||
render() { | ||
const siteTitle = this.props.data.site.siteMetadata.title | ||
const siteDescription = this.props.data.site.siteMetadata.description | ||
const posts = this.props.data.allMarkdownRemark.edges | ||
|
||
return ( | ||
<Layout location={this.props.location}> | ||
<Helmet | ||
htmlAttributes={{ lang: 'en' }} | ||
meta={[{ name: 'description', content: siteDescription }]} | ||
title={siteTitle} | ||
/> | ||
{posts.map(({ node }) => { | ||
const title = node.frontmatter.title || node.fields.slug | ||
return ( | ||
<div key={node.fields.slug}> | ||
<h3> | ||
<Link style={{ boxShadow: 'none' }} to={node.fields.slug}> | ||
{title} | ||
</Link> | ||
</h3> | ||
<small>{node.frontmatter.date}</small> | ||
<p dangerouslySetInnerHTML={{ __html: node.excerpt }} /> | ||
</div> | ||
) | ||
})} | ||
</Layout> | ||
) | ||
} | ||
} | ||
|
||
export default IndexPage | ||
|
||
export const pageQuery = graphql` | ||
query { | ||
site { | ||
siteMetadata { | ||
title | ||
description | ||
} | ||
} | ||
allMarkdownRemark(sort: { fields: [frontmatter___date], order: DESC }) { | ||
edges { | ||
node { | ||
excerpt | ||
fields { | ||
slug | ||
} | ||
frontmatter { | ||
date(formatString: "DD MMMM, YYYY") | ||
title | ||
} | ||
} | ||
} | ||
} | ||
} | ||
` |
Oops, something went wrong.