Skip to content

Commit 282d162

Browse files
committed
[ADD] GatsbyJS setup: styled-components, tailwindcss, i18next(translation)
1 parent 9a041ee commit 282d162

25 files changed

+43687
-0
lines changed

.gitignore

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.vscode
2+
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (http://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# Typescript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# dotenv environment variable files
57+
.env*
58+
59+
# gatsby files
60+
.cache/
61+
public
62+
63+
# Mac files
64+
.DS_Store
65+
66+
# Yarn
67+
yarn-error.log
68+
.pnp/
69+
.pnp.js
70+
# Yarn Integrity file
71+
.yarn-integrity

gatsby-browser.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "./src/styles/tailwind.css"

gatsby-config.js

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module.exports = {
2+
siteMetadata: {
3+
title: `CoderBunker`,
4+
author: `Carms Ng`,
5+
description: `coderbunker.ca Website`,
6+
},
7+
plugins: [
8+
"gatsby-plugin-sharp",
9+
"gatsby-transformer-sharp",
10+
`gatsby-plugin-react-helmet`,
11+
`gatsby-plugin-postcss`,
12+
`gatsby-plugin-styled-components`,
13+
{
14+
resolve: `gatsby-source-filesystem`,
15+
options: {
16+
name: `images`,
17+
path: `${__dirname}/src/assets/images`,
18+
},
19+
__key: "images",
20+
},
21+
{
22+
resolve: `gatsby-source-filesystem`,
23+
options: {
24+
path: `${__dirname}/locales`,
25+
name: `locale`
26+
}
27+
},
28+
{
29+
resolve: `gatsby-plugin-react-i18next`,
30+
options: {
31+
localeJsonSourceName: `locale`, // name given to `gatsby-source-filesystem` plugin.
32+
languages: [`en`, `fr`],
33+
defaultLanguage: `en`,
34+
// if you are using Helmet, you must include siteUrl, and make sure you add http:https
35+
siteUrl: `https://example.com/`,
36+
// you can pass any i18next options
37+
// pass following options to allow message content as a key
38+
i18nextOptions: {
39+
interpolation: {
40+
escapeValue: false // not needed for react as it escapes by default
41+
},
42+
keySeparator: false,
43+
nsSeparator: false
44+
},
45+
pages: [
46+
{
47+
matchPath: '/preview',
48+
languages: ['en']
49+
}
50+
]
51+
}
52+
}
53+
],
54+
};

locales/en/translation.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Home": "Home",
3+
"Hi people": "Hi people",
4+
"Welcome to your new Gatsby site.": "Welcome to your new Gatsby site.",
5+
"Now go build something great.": "Now go build something great.",
6+
"Go to page 2": "Go to page 2",
7+
"Page two": "Page two",
8+
"Hi from the second page": "Hi from the second page",
9+
"Welcome to page 2": "Welcome to page 2",
10+
"Go back to the homepage": "Go back to the homepage"
11+
}

locales/fr/translation.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Home": "Maison",
3+
"Hi people": "Salut peeps",
4+
"Welcome to your new Gatsby site.": "Bienvenue a your new Gatsby site.",
5+
"Now go build something great.": "Maintenent go build something great.",
6+
"Go to page 2": "Allez a page 2",
7+
"Page two": "Page deux",
8+
"Hi from the second page": "Salut de page deux",
9+
"Welcome to page 2": "Bienvenue a page deux",
10+
"Go back to the homepage": "Retour a Maison"
11+
}

0 commit comments

Comments
 (0)