Skip to content

Commit

Permalink
Merge pull request #2 from ekoeryanto/lint
Browse files Browse the repository at this point in the history
feat: add linter
  • Loading branch information
v4iv authored Apr 13, 2018
2 parents bf8e1d0 + 5b481a3 commit 7667c01
Show file tree
Hide file tree
Showing 35 changed files with 1,744 additions and 1,231 deletions.
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parser": "babel-eslint",
"extends": ["standard", "standard-trailing-commas", "standard-react"],
"globals": {
"graphql": true,
"__PATH_PREFIX__": true
},
"rules": {
"react/prop-types": "off",
"camelcase": "off"
}
}
246 changes: 123 additions & 123 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,109 +1,109 @@
/**
* Created by vaibhav on 31/3/18
*/
const config = require("./meta/config");
const config = require('./meta/config')

const pathPrefix = config.pathPrefix === "/" ? "" : config.pathPrefix;
const pathPrefix = config.pathPrefix === '/' ? '' : config.pathPrefix

module.exports = {
siteMetadata: {
title: config.siteTitle,
siteUrl: config.siteUrl,
rssMetadata: {
site_url: config.siteUrl + pathPrefix,
feed_url: config.siteUrl + pathPrefix + config.siteRss,
title: config.siteTitle,
description: config.siteDescription,
image_url: `${config.siteUrl + pathPrefix}/icons/icon-512x512.png`,
author: config.userName,
copyright: config.copyright
}
siteMetadata: {
title: config.siteTitle,
siteUrl: config.siteUrl,
rssMetadata: {
site_url: config.siteUrl + pathPrefix,
feed_url: config.siteUrl + pathPrefix + config.siteRss,
title: config.siteTitle,
description: config.siteDescription,
image_url: `${config.siteUrl + pathPrefix}/icons/icon-512x512.png`,
author: config.userName,
copyright: config.copyright,
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-sass',
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
},
},
{
resolve: `gatsby-plugin-sitemap`
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/img`,
name: 'images',
},
},
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [],
},
},
{
resolve: 'gatsby-plugin-netlify-cms',
options: {
modulePath: `${__dirname}/src/cms/cms.js`,
},
},
`gatsby-plugin-offline`,
{
resolve: `gatsby-plugin-nprogress`,
options: {
// Setting a color is optional.
color: config.themeColor,
// Disable the loading spinner.
showSpinner: false,
},
},
{
resolve: `gatsby-plugin-google-tagmanager`,
options: {
id: config.googleTagManagerID,
includeInDevelopment: false,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: config.siteTitle,
short_name: config.siteTitleAlt,
start_url: "/",
background_color: config.backgroundColor,
theme_color: config.themeColor,
display: "standalone",
icons: [
{
src: `/icons/icon-192x192.png`,
sizes: `192x192`,
type: `image/png`,
},
{
src: `/icons/icon-512x512.png`,
sizes: `512x512`,
type: `image/png`,
},
],
},
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-sass',
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
},
},
{
resolve: `gatsby-plugin-sitemap`,
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/img`,
name: 'images',
},
},
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [],
},
},
{
resolve: 'gatsby-plugin-netlify-cms',
options: {
modulePath: `${__dirname}/src/cms/cms.js`,
},
},
`gatsby-plugin-offline`,
{
resolve: `gatsby-plugin-nprogress`,
options: {
// Setting a color is optional.
color: config.themeColor,
// Disable the loading spinner.
showSpinner: false,
},
},
{
resolve: `gatsby-plugin-google-tagmanager`,
options: {
id: config.googleTagManagerID,
includeInDevelopment: false,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: config.siteTitle,
short_name: config.siteTitleAlt,
start_url: '/',
background_color: config.backgroundColor,
theme_color: config.themeColor,
display: 'standalone',
icons: [
{
src: `/icons/icon-192x192.png`,
sizes: `192x192`,
type: `image/png`,
},
{
src: `/icons/icon-512x512.png`,
sizes: `512x512`,
type: `image/png`,
},
],
},

},
{
resolve: 'gatsby-plugin-feed',
options: {
setup (ref) {
const ret = ref.query.site.siteMetadata.rssMetadata
ret.allMarkdownRemark = ref.query.allMarkdownRemark
ret.generator = 'GatsbyJS Business Starter'
return ret
},
{
resolve: "gatsby-plugin-feed",
options: {
setup(ref) {
const ret = ref.query.site.siteMetadata.rssMetadata;
ret.allMarkdownRemark = ref.query.allMarkdownRemark;
ret.generator = "GatsbyJS Business Starter";
return ret;
},
query: `
query: `
{
site {
siteMetadata {
Expand All @@ -120,24 +120,24 @@ module.exports = {
}
}
`,
feeds: [
{
serialize(ctx) {
const rssMetadata = ctx.query.site.siteMetadata.rssMetadata;
return ctx.query.allMarkdownRemark.edges
.filter(edge => edge.node.frontmatter.templateKey === 'article-page')
.map(edge => ({
categories: edge.node.frontmatter.tags,
date: edge.node.frontmatter.date,
title: edge.node.frontmatter.title,
description: edge.node.excerpt,
author: rssMetadata.author,
url: rssMetadata.site_url + edge.node.fields.slug,
guid: rssMetadata.site_url + edge.node.fields.slug,
custom_elements: [{"content:encoded": edge.node.html}]
}));
},
query: `
feeds: [
{
serialize (ctx) {
const rssMetadata = ctx.query.site.siteMetadata.rssMetadata
return ctx.query.allMarkdownRemark.edges
.filter(edge => edge.node.frontmatter.templateKey === 'article-page')
.map(edge => ({
categories: edge.node.frontmatter.tags,
date: edge.node.frontmatter.date,
title: edge.node.frontmatter.title,
description: edge.node.excerpt,
author: rssMetadata.author,
url: rssMetadata.site_url + edge.node.fields.slug,
guid: rssMetadata.site_url + edge.node.fields.slug,
custom_elements: [{'content:encoded': edge.node.html}],
}))
},
query: `
{
allMarkdownRemark(
limit: 1000,
Expand All @@ -161,12 +161,12 @@ module.exports = {
}
}
`,
output: config.siteRss
}
]
}
},
'gatsby-plugin-netlify'
],
};
output: config.siteRss,
},
],
},
},
'gatsby-plugin-netlify',
],
}

Loading

0 comments on commit 7667c01

Please sign in to comment.