-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgatsby-config.js
205 lines (200 loc) · 10 KB
/
gatsby-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
const path = require('path');
const customQueries = {
se: '(max-height: 670px)',
xs: '(max-width: 500px)',
s: '(max-width: 600px)',
sm: '(max-width: 720px)',
m: '(max-width: 821px)',
md: '(max-width: 1279px)',
l: '(max-width: 1536px)',
minxl: '(min-width: 1920px)',
xl: '(max-width: 1926px)',
xxl: '(min-width: 1930px)',
isLoad: '(min-width: 320px)',
};
module.exports = {
siteMetadata: {
title: 'Modular House',
},
// flags: { PRESERVE_WEBPACK_CACHE: true },
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${path.join(__dirname, '../images')}`,
},
},
`gatsby-plugin-react-helmet`,
`gatsby-plugin-material-ui`,
{
resolve: `gatsby-source-mysql`,
options: {
connectionDetails: {
host: 'localhost',
user: 'modularh_user',
password: 'modularhouse',
database: 'modularh_db',
},
queries: [
// all houses
{
statement: `SELECT modx_site_tmplvar_contentvalues.id,modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value, modx_site_content.published, modx_site_content.id AS contentID, modx_site_content.alias, modx_site_content.menutitle AS position
FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_templates.templatename = "Дом"`,
idFieldName: 'id',
name: 'Houses',
},
// all houses english
{
statement: `SELECT modx_site_tmplvar_contentvalues.id,modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value, modx_site_content.published, modx_site_content.id AS contentID, modx_site_content.alias, modx_site_content.menutitle AS position
FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_templates.templatename = "Дом-en"`,
idFieldName: 'id',
name: 'HousesEn',
},
// main page
{
statement: `SELECT modx_site_tmplvar_contentvalues.id, modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value,
modx_site_content.alias FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_content.alias = "index"`,
idFieldName: 'id',
name: 'MainPage',
},
// main page english
{
statement: `SELECT modx_site_tmplvar_contentvalues.id, modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value,
modx_site_content.alias FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_content.alias = "index-en"`,
idFieldName: 'id',
name: 'MainPageEn',
},
// about us
{
statement: `SELECT modx_site_tmplvar_contentvalues.id, modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value,
modx_site_content.alias FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_content.alias = "whoweare"`,
idFieldName: 'id',
name: 'AboutUs',
},
// about us english
{
statement: `SELECT modx_site_tmplvar_contentvalues.id, modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value,
modx_site_content.alias FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_content.alias = "whoweare-en"`,
idFieldName: 'id',
name: 'AboutUsEn',
},
// contacts
{
statement: `SELECT modx_site_tmplvar_contentvalues.id, modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value,
modx_site_content.alias FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_content.alias = "contacts"`,
idFieldName: 'id',
name: 'Contacts',
},
// contacts english
{
statement: `SELECT modx_site_tmplvar_contentvalues.id, modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value,
modx_site_content.alias FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_content.alias = "contacts-en"`,
idFieldName: 'id',
name: 'ContactsEn',
},
// arenda
{
statement: `SELECT modx_site_tmplvar_contentvalues.id as idname, modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value,
modx_site_content.alias FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_content.alias = "arenda"`,
idFieldName: 'idname',
name: 'Arenda',
},
// arenda english
{
statement: `SELECT modx_site_tmplvar_contentvalues.id as idname, modx_site_tmplvars.name, modx_site_tmplvar_contentvalues.value,
modx_site_content.alias FROM modx_site_tmplvar_contentvalues
JOIN modx_site_tmplvars ON modx_site_tmplvars.id = modx_site_tmplvar_contentvalues.tmplvarid
JOIN modx_site_content ON modx_site_tmplvar_contentvalues.contentid = modx_site_content.id
JOIN modx_site_templates ON modx_site_content.template = modx_site_templates.id
WHERE modx_site_content.alias = "arenda-en"`,
idFieldName: 'idname',
name: 'ArendaEn',
},
// menu
{
statement: `SELECT modx_site_content.id, modx_site_content.longtitle as name,modx_site_content.link_attributes as link, modx_site_content.published,modx_site_content.menutitle
FROM modx_site_content
WHERE modx_site_content.introtext = "RU"`,
idFieldName: 'id',
name: 'Menu',
},
// menu english
{
statement: `SELECT modx_site_content.id, modx_site_content.longtitle as name,modx_site_content.link_attributes as link, modx_site_content.published,modx_site_content.menutitle
FROM modx_site_content
WHERE modx_site_content.introtext = "EN"`,
idFieldName: 'id',
name: 'MenuEn',
},
],
},
},
`gatsby-plugin-image`,
{
resolve: 'gatsby-plugin-breakpoints',
options: {
queries: customQueries,
},
},
{
resolve: `gatsby-plugin-yandex-metrika`,
options: {
// The ID of yandex metrika.
trackingId: 57371404,
// Enabled a webvisor. The default value is `false`.
webvisor: true,
// Enables tracking a hash in URL. The default value is `false`.
trackHash: true,
// Defines where to place the tracking script - `false` means before body (slower loading, more hits)
// and `true` means after the body (faster loading, less hits). The default value is `false`.
afterBody: true,
// Use `defer` attribute of metrika script. If set to `false` - script will be loaded with `async` attribute.
// Async enables earlier loading of the metrika but it can negatively affect page loading speed. The default value is `false`.
defer: false,
},
},
// {
// resolve: "gatsby-plugin-webpack-bundle-analyser-v2",
// options: {
// devMode: true,
// },
// },
],
};