Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grommetify gatsby starter project #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
siteMetadata: {
title: 'Gatsby + Netlify CMS Starter',
description: 'This repo contains an example business website that is built with Gatsby, and Netlify CMS.It follows the JAMstack architecture by using Git as a single source of truth, and Netlify for continuous deployment, and CDN distribution.',
title: 'Gatsby + Grommet + Netlify CMS Starter',
description: 'This repo contains an example business website that is built with Gatsby, Grommet and Netlify CMS.It follows the JAMstack architecture by using Git as a single source of truth, and Netlify for continuous deployment, and CDN distribution.',
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-sass',
'gatsby-plugin-styled-components',
{
// keep as first gatsby-source-filesystem plugin for gatsby image support
resolve: 'gatsby-source-filesystem',
Expand Down
53 changes: 21 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"gatsby-plugin-react-helmet": "^3.0.4",
"gatsby-plugin-sass": "^2.0.7",
"gatsby-plugin-sharp": "^2.0.15",
"gatsby-plugin-styled-components": "^3.0.5",
"gatsby-remark-copy-linked-files": "^2.0.7",
"gatsby-remark-images": "^3.0.1",
"gatsby-remark-relative-images": "^0.2.1",
Expand Down
2 changes: 0 additions & 2 deletions src/cms/cms.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import CMS from 'netlify-cms'

import AboutPagePreview from './preview-templates/AboutPagePreview'
import BlogPostPreview from './preview-templates/BlogPostPreview'
import ProductPagePreview from './preview-templates/ProductPagePreview'

CMS.registerPreviewTemplate('about', AboutPagePreview)
CMS.registerPreviewTemplate('products', ProductPagePreview)
CMS.registerPreviewTemplate('blog', BlogPostPreview)
56 changes: 0 additions & 56 deletions src/cms/preview-templates/ProductPagePreview.js

This file was deleted.

76 changes: 52 additions & 24 deletions src/components/Layout.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,74 @@
import React from 'react'
import Helmet from 'react-helmet'
import { StaticQuery, graphql } from "gatsby"
import React from "react";
import Helmet from "react-helmet";
import { StaticQuery, graphql } from "gatsby";

import Navbar from '../components/Navbar'
import './all.sass'
import Navbar from "../components/Navbar";

import { Grommet, Box } from "grommet";
import { grommet } from "grommet/themes";

const TemplateWrapper = ({ children }) => (
<StaticQuery
query={graphql`
query HeadingQuery {
site {
siteMetadata {
title,
description,
}
site {
siteMetadata {
title
description
}
}
}
`}
render={data => (
<div>
<Helmet>
<html lang="en" />
<title>{data.site.siteMetadata.title}</title>
<meta name="description" content={data.site.siteMetadata.description} />

<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png" />
<link rel="icon" type="image/png" href="/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="/img/favicon-16x16.png" sizes="16x16" />

<link rel="mask-icon" href="/img/safari-pinned-tab.svg" color="#ff4400" />
<meta name="theme-color" content="#fff" />

<meta property="og:type" content="business.business" />
<meta
name="description"
content={data.site.siteMetadata.description}
/>

<link
rel="apple-touch-icon"
sizes="180x180"
href="/img/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
href="/img/favicon-32x32.png"
sizes="32x32"
/>
<link
rel="icon"
type="image/png"
href="/img/favicon-16x16.png"
sizes="16x16"
/>

<link
rel="mask-icon"
href="/img/safari-pinned-tab.svg"
color="#ff4400"
/>
<meta name="theme-color" content="#fff" />

<meta property="og:type" content="business.business" />
<meta property="og:title" content={data.site.siteMetadata.title} />
<meta property="og:url" content="/" />
<meta property="og:image" content="/img/og-image.jpg" />
</Helmet>
<Navbar />
<div>{children}</div>

{/* Sketch out grommet components */}
<Grommet theme={grommet}>
<Navbar />

<Box>{children}</Box>
</Grommet>
</div>
)}
/>
)
);

export default TemplateWrapper
export default TemplateWrapper;
Loading