Skip to content

Commit 6fa5c5a

Browse files
committed
upgraded to gatsby v2
1 parent 29bbc98 commit 6fa5c5a

File tree

71 files changed

+4321
-17169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4321
-17169
lines changed

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

content/docs/containers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ title: 'Containers'
1717
## container
1818

1919
<div class="container mb2 bg-custom">
20-
<h2>1200px</h2>
20+
<h2>1280px</h2>
2121
</div>
2222

2323
```html

content/posts/test.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

data/Config.js

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
module.exports = {
2-
googleAnalyticsID: "UA-106122837-1",
3-
themeColor: "#09b4e0",
4-
backgroundColor: "#09b4e0",
5-
siteURL: "https://unnamed.smakosh.com",
6-
siteDescription: "A colorful css framework",
7-
siteName: "Unnamed"
8-
}
2+
title: 'Unnamed css – An open source colorful css framework',
3+
siteName: 'Unnamed',
4+
logo: 'https://unnamed.smakosh.com/favicon/logo-192.png',
5+
url: 'https://unnamed.smakosh.com',
6+
favicon: 'https://unnamed.smakosh.com/favicon/logo-48.png',
7+
cover: 'https://unnamed.smakosh.com/unnamed.jpeg',
8+
legalName: 'Unnamed css',
9+
description: 'An open source colorful css framework',
10+
socialLinks: {
11+
twitter: 'https://twitter.com/Unnamedcss',
12+
github: 'https://github.com/smakosh/unnamed-css-framework',
13+
},
14+
googleAnalyticsID: 'UA-106122837-1',
15+
themeColor: '#09b4e0',
16+
backgroundColor: '#09b4e0',
17+
social: {
18+
twitter: '@Unnamedcss',
19+
},
20+
address: {
21+
city: 'Errachidia',
22+
region: 'Deraa-Tafilalet',
23+
country: 'Morocco',
24+
zipCode: '52000',
25+
},
26+
contact: {
27+
email: 'ismai23l@hotmail.com',
28+
phone: '+212 663 53 27 61',
29+
},
30+
foundingDate: '2017'
31+
}

gatsby-config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
const config = require('./data/Config');
22

33
module.exports = {
4+
siteMetadata: {
5+
title: config.title,
6+
},
47
plugins: [
58
'gatsby-plugin-react-helmet',
69
'gatsby-plugin-sass',
7-
'gatsby-plugin-react-next',
810
{
911
resolve: 'gatsby-plugin-canonical-urls',
1012
options: {
11-
siteUrl: config.siteURL,
13+
siteUrl: config.url,
1214
},
1315
},
1416
'gatsby-plugin-catch-links',
@@ -38,8 +40,8 @@ module.exports = {
3840
{
3941
resolve: 'gatsby-source-filesystem',
4042
options: {
41-
name: 'posts',
42-
path: `${__dirname}/content/`,
43+
name: 'docs',
44+
path: `${__dirname}/content/docs/`,
4345
},
4446
},
4547
{
@@ -64,7 +66,7 @@ module.exports = {
6466
start_url: '/',
6567
background_color: config.backgroundColor,
6668
theme_color: config.themeColor,
67-
display: 'minimal-ui',
69+
display: 'fullscreen',
6870
icons: [
6971
{
7072
src: '/favicon/logo-192x192.png',

gatsby-node.js

Lines changed: 31 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
const path = require('path')
22
const _ = require('lodash')
3-
const webpackLodashPlugin = require('lodash-webpack-plugin')
43

5-
exports.onCreateNode = ({ node, boundActionCreators, getNode }) => {
6-
const { createNodeField } = boundActionCreators
4+
exports.onCreateNode = ({ node, actions, getNode }) => {
5+
const { createNodeField } = actions
76
let slug = '/docs/'
87
if (node.internal.type === 'MarkdownRemark') {
98
const fileNode = getNode(node.parent)
@@ -30,60 +29,43 @@ exports.onCreateNode = ({ node, boundActionCreators, getNode }) => {
3029
}
3130
}
3231

33-
exports.createPages = ({ graphql, boundActionCreators }) => {
34-
const { createPage } = boundActionCreators
32+
exports.createPages = ({ graphql, actions }) => {
33+
const { createPage } = actions
3534

3635
return new Promise((resolve, reject) => {
37-
const postPage = path.resolve('src/templates/post.jsx')
3836
const docItemPage = path.resolve('src/templates/item.jsx')
39-
resolve(
40-
graphql(`
41-
{
42-
allMarkdownRemark {
43-
edges {
44-
node {
45-
frontmatter {
46-
title
47-
type
48-
}
49-
fields {
50-
slug
51-
}
37+
38+
graphql(`
39+
{
40+
allMarkdownRemark {
41+
edges {
42+
node {
43+
frontmatter {
44+
title
45+
}
46+
fields {
47+
slug
5248
}
5349
}
5450
}
55-
}`)
56-
.then(result => {
57-
if (result.errors) {
58-
reject(result.errors)
59-
}
51+
}
52+
}`)
53+
.then(result => {
54+
if (result.errors) {
55+
return reject(result.errors)
56+
}
6057

61-
result.data.allMarkdownRemark.edges.forEach(edge => {
62-
if (edge.node.frontmatter.type === 'post') {
63-
createPage({
64-
path: edge.node.fields.slug,
65-
component: postPage,
66-
context: {
67-
slug: edge.node.fields.slug,
68-
},
69-
})
70-
} else {
71-
createPage({
72-
path: edge.node.fields.slug,
73-
component: docItemPage,
74-
context: {
75-
slug: edge.node.fields.slug,
76-
},
77-
})
78-
}
58+
return result.data.allMarkdownRemark.edges.forEach(edge => {
59+
createPage({
60+
path: edge.node.fields.slug,
61+
component: docItemPage,
62+
context: {
63+
slug: edge.node.fields.slug,
64+
},
7965
})
66+
67+
resolve()
8068
})
81-
)
69+
})
8270
})
8371
}
84-
85-
exports.modifyWebpackConfig = ({ config, stage }) => {
86-
if (stage === 'build-javascript') {
87-
config.plugin('Lodash', webpackLodashPlugin, null)
88-
}
89-
}

0 commit comments

Comments
 (0)