-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.ts
152 lines (146 loc) · 4.12 KB
/
gatsby-config.ts
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
import type { AdapterInit, GatsbyConfig } from "gatsby";
import { collections } from "./collections";
const noOpAdapter: AdapterInit = () => ({
name: `gatsby-adapter-noop`,
adapt() {
// noop
},
});
require("dotenv").config({
path: `.env`, // ${process.env.NODE_ENV}
});
module.exports = {
adapter: noOpAdapter(),
plugins: [
`gatsby-plugin-styled-components`,
/*
* Gatsby's data processing layer begins with “source” plugins. Here we
* setup the site to pull data from the "documents" collection in a local
* MongoDB instance
*/
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `logCiCa Explore`,
short_name: `Explore`,
start_url: `/`,
background_color: `#FFFFFF`,
theme_color: `#ffcb01`,
display: `standalone`,
icon: `src/images/favicon.svg`,
screenshots: [
{
src: "/img/explore-v2-large.png",
sizes: "800x385",
type: "image/png",
//form_factor: "wide" -> not working
label: "Application",
},
],
},
},
{
resolve: `gatsby-plugin-algolia`,
options: {
appId: process.env.GATSBY_ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_ADMIN_KEY,
queries: require("./src/utils/algolia-queries"),
//dryRun: true
},
},
{
resolve: `gatsby-source-mongodb`,
options: {
typePrefix: "",
dbName: process.env.MONGO_DB_NAME,
collection: collections,
connectionString: process.env.MONGO_CONNECTION_STRING,
extraParams: {
appName: "Cluster0",
},
query: {},
preserveObjectIds: false,
},
//query: { documents: { as_of: { $gte: 1604397088013 } } },
},
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /assets/, // See below to configure properly
},
},
},
{
resolve: "gatsby-plugin-react-leaflet",
options: {
linkStyles: false, // (default: true) Enable/disable loading stylesheets via CDN
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/locales`,
name: `locale`,
},
},
{
resolve: `gatsby-plugin-react-i18next`,
options: {
localeJsonSourceName: `locale`, // name given to `gatsby-source-filesystem` plugin.
languages: [`fr`, `en`],
defaultLanguage: `fr`,
siteUrl: `https://explore.logcica.org/`,
// if you are using trailingSlash gatsby config include it here, as well (the default is 'always')
trailingSlash: "always",
// you can pass any i18next options
i18nextOptions: {
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
keySeparator: false,
nsSeparator: false,
defaultNS: "common",
},
pages: [
{
matchPath: "/v2",
languages: ["fr", "en"],
},
{
matchPath: "/:any",
languages: ["fr"],
},
{
matchPath: "/:any/:any1",
languages: ["fr"],
},
{
matchPath: "/:any/:any1/:any2",
languages: ["fr"],
},
],
},
},
],
};
const config: GatsbyConfig = {
siteMetadata: {
title: `logCiCa explore`,
siteUrl: `https://explore.logcica.org`,
menuLinks: [
{ name: "PRODUCTEURS", url: "/" },
{ name: "GROUPEMENTS", url: "/partnership" },
{ name: "MARCHÉS", url: "/marketplace" },
{ name: "PRODUITS", url: "/product" },
{ name: "RECIPE", url: "/recipe" },
{ name: "ÉVÉNEMENTS", url: "/event" },
],
},
// More easily incorporate content into your pages through automatic TypeScript type generation and better GraphQL IntelliSense.
// If you use VSCode you can also use the GraphQL plugin
// Learn more at: https://gatsby.dev/graphql-typegen
graphqlTypegen: true,
plugins: ["gatsby-plugin-styled-components"],
};
export default config;