Skip to content

Commit

Permalink
Added Starter Config For New Project
Browse files Browse the repository at this point in the history
  • Loading branch information
nirlom-team committed Dec 9, 2019
1 parent 30a15b1 commit dfe784b
Show file tree
Hide file tree
Showing 19 changed files with 24,239 additions and 1 deletion.
Empty file added .env
Empty file.
18 changes: 18 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": [
"wesbos"
],
"rules": {
"no-console": 1,
"no-multi-assign": 2,
"jsx-a11y/html-has-lang": 0,
"react/destructuring-assignment": 0,
"react/no-danger": 0,
"prettier/prettier": [
"error",
{
"singleQuote": true
}
]
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.cache
public
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# news-feeds
## Nirlom Gatsby Starter
16 changes: 16 additions & 0 deletions data/site-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
name: 'Nirlom Gatsby Starter',
shortName: 'Gatsby Starter',
title: 'Nirlom Gatsby Starter',
logo: `${__dirname}/../src/static/images/logo/nirlom.png`,
siteUrl: 'https://nirlom.com',
keyword: 'Nirlom, Nirlom Gatsby Starter',
description: 'Nirlom Gatsby Starter',
type: 'website',
author: 'Nirlom',
lang: 'en',
googleAnalyticsID: 'UA-139553191-1', // GA tracking ID.
backgroundColor: '#fff',
themeColor: '#fff',
favicon: `${__dirname}/../src/static/images/favicon.png`
};
81 changes: 81 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
require('dotenv').config();
const path = require('path');

const {
name,
shortName,
title,
description,
themeColor,
backgroundColor,
siteUrl,
logo,
author,
type,
googleAnalyticsID,
favicon
} = require('./data/site-config');

module.exports = {
siteMetadata: {
title,
description,
author,
siteUrl,
logo,
type,
favicon
},
plugins: [
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-plugin-google-analytics',
options: {
trackingId: googleAnalyticsID,
head: true
}
},
{
resolve: `gatsby-plugin-purgecss`,
options: {
printRejected: true // Print removed selectors and processed file names
// develop: true, // Enable while using `gatsby develop`
// tailwind: true, // Enable tailwindcss support
// whitelist: ['whitelist'], // Don't remove this selector
// ignore: ['/ignored.css', 'prismjs/', 'docsearch.js/'], // Ignore files/folders
// purgeOnly : ['components/', '/main.css', 'bootstrap/'], // Purge only these files/folders
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: path.join(__dirname, `src`, `static/images`)
}
},
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
{
resolve: `gatsby-plugin-manifest`,
options: {
name,
short_name: shortName,
start_url: '/',
background_color: backgroundColor,
theme_color: themeColor,
display: 'minimal-ui',
icon: favicon
}
},
'gatsby-plugin-offline',
'gatsby-plugin-sitemap',
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: siteUrl,
sitemap: `${siteUrl}/sitemap.xml`,
policy: [{ userAgent: '*', disallow: '' }]
}
}
]
};
8 changes: 8 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path');

exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions;
return new Promise((resolve, reject) => {
resolve();
});
};
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "gatsby-starter",
"version": "1.0.0",
"description": "Nirlom Gatsby Starter",
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"build": "gatsby build",
"start": "gatsby develop",
"serve": "gatsby serve",
"clean": "gatsby clean"
},
"keywords": [],
"author": "Nirlom <tech@nirlom.com>",
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/nirlom/gatsby-starter"
},
"devDependencies": {
"babel-eslint": "^9.0.0",
"eslint": "^5.14.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-config-wesbos": "0.0.19",
"eslint-plugin-html": "^5.0.3",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.3.0",
"prettier": "^1.16.4"
},
"dependencies": {
"dotenv": "^8.2.0",
"gatsby": "^2.18.7",
"gatsby-image": "^2.2.34",
"gatsby-plugin-google-analytics": "^2.1.29",
"gatsby-plugin-manifest": "^2.2.31",
"gatsby-plugin-offline": "^3.0.27",
"gatsby-plugin-purgecss": "^4.0.1",
"gatsby-plugin-react-helmet": "^3.1.16",
"gatsby-plugin-robots-txt": "^1.5.0",
"gatsby-plugin-sharp": "^2.3.5",
"gatsby-plugin-sitemap": "^2.2.22",
"gatsby-source-filesystem": "^2.1.40",
"gatsby-transformer-sharp": "^2.3.7",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-helmet": "^5.2.1",
"simple-load-script": "^1.0.2"
},
"main": "gatsby-node.js"
}
14 changes: 14 additions & 0 deletions src/components/importScripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React, { Component } from 'react';
import loadScript from 'simple-load-script';

class ImportScripts extends Component {
componentDidMount() {
loadScript('/js/main.js?v=1');
}

render() {
return <script />;
}
}

export default ImportScripts;
68 changes: 68 additions & 0 deletions src/components/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import React from 'react';
import { graphql, StaticQuery } from 'gatsby';
import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
import '../static/css/style.css';

import ImportScripts from './importScripts';

const Layout = props => (
<StaticQuery
query={graphql`
query IndexPage {
site {
siteMetadata {
description
title
author
type
logo
favicon
siteUrl
}
}
}
`}
render={({ site }) => {
const { siteMetadata } = site;
const { children } = props;

return (
<>
<Helmet
title={siteMetadata.title}
meta={[
{
name: 'description',
content: siteMetadata.description
},
{ name: 'author', content: siteMetadata.author },
{ property: 'og:url', content: siteMetadata.siteUrl },
{
property: 'og:image',
content: `${siteMetadata.siteUrl}/images/favicon.png`
},
{ property: 'og:title', content: siteMetadata.title },
{ property: 'og:type', content: siteMetadata.type },
{
property: 'og:description',
content: siteMetadata.description
}
]}
link={[{ rel: 'canonical', href: siteMetadata.siteUrl }]}
>
<html lang={siteMetadata.lang} />
</Helmet>
<main>{children}</main>
<ImportScripts />
</>
);
}}
/>
);

Layout.propTypes = {
children: PropTypes.node.isRequired
};

export default Layout;
35 changes: 35 additions & 0 deletions src/pages/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import { graphql } from 'gatsby';
import Img from 'gatsby-image';
import PropTypes from 'prop-types';

import Layout from '../components/layout';

const IndexPage = ({ data }) => (
<Layout>
<h1>Page Not Found</h1>
<Img fixed={data.file.childImageSharp.fixed} />
</Layout>
);

IndexPage.propTypes = {
data: PropTypes.shape({
file: {
childImageSharp: {}
}
})
};
export default IndexPage;
export const query = graphql`
query {
file(relativePath: { eq: "logo/nirlom.png" }) {
childImageSharp {
# Specify the image processing specifications right in the query.
# Makes it trivial to update as your page's design changes.
fixed(width: 125, height: 125) {
...GatsbyImageSharpFixed
}
}
}
}
`;
35 changes: 35 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import { graphql } from 'gatsby';
import Img from 'gatsby-image';
import PropTypes from 'prop-types';

import Layout from '../components/layout';

const IndexPage = ({ data }) => (
<Layout>
<h1>Hello Nirlom Starter Page</h1>
<Img fluid={data.file.childImageSharp.fluid} />
</Layout>
);

IndexPage.propTypes = {
data: PropTypes.shape({
file: {
childImageSharp: {}
}
})
};
export default IndexPage;
export const query = graphql`
query {
file(relativePath: { eq: "logo/nirlom.png" }) {
childImageSharp {
# Specify the image processing specifications right in the query.
# Makes it trivial to update as your page's design changes.
fluid {
...GatsbyImageSharpFluid
}
}
}
}
`;
Empty file added src/static/css/style.css
Empty file.
Binary file added src/static/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/static/images/logo/nirlom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added static/main.js
Empty file.
Loading

0 comments on commit dfe784b

Please sign in to comment.