Newer
Older
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
var dotenv = require("dotenv");
var dotenvExpand = require("dotenv-expand");
var myEnv = dotenv.config();
dotenvExpand.expand(myEnv);
module.exports = {
siteMetadata: {
title: `Onegeo Portal`,
subtitle: `Hub géospatial collaboratif`,
description: `Solution Open Source sur-mesure pour communiquer et valoriser les données disponibles sur votre territoire ou vos infrastructures`,
author: `GEOFIT`,
icon: ``,
theme: "light",
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-typescript`,
`gatsby-plugin-image`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-sitemap`,
{
resolve: `gatsby-plugin-env-variables`,
options: {
allowList: [
"PROJECT_INTERNAL_PROTOCOL",
"PROJECT_INTERNAL_HOST",
"PROJECT_INTERNAL_PORT",
"PROJECT_PROTOCOL",
"PROJECT_HOST",
"PROJECT_PORT",
"PROJECT_URL",
"TYPESENSE_API_PATH",
// TODO add API_TOKEN with Read Only privileges (client use)
"TYPESENSE_API_TOKEN",
],
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
process.env.NODE_ENV === `development`
? {
resolve: `gatsby-plugin-page-creator`,
options: {
path: `${__dirname}/src/pages-doc`,
},
}
: {
resolve: `gatsby-plugin-page-creator`,
options: {
path: `${__dirname}/src/pages`,
},
},
{
resolve: "gatsby-source-graphql",
options: {
// Arbitrary name for the remote schema Query type
typeName: "api",
// Field under which the remote schema will be accessible. You'll use this in your Gatsby query
fieldName: "api",
// PROJECT_INTERNAL_* use docker hostname (whd build) and not public DNS (not always available from whd)
url:
(process.env.PROJECT_INTERNAL_PROTOCOL ||
process.env.PROJECT_PROTOCOL ||
"http") +
"://" +
(process.env.PROJECT_INTERNAL_HOST ||
process.env.PROJECT_HOST ||
"geokumo.apps.geofit.fr") +
":" +
(process.env.PROJECT_INTERNAL_PORT ||
process.env.PROJECT_PORT ||
"80") +
"/api/v1/graphql",
headers: {
// Learn about environment variables: https://gatsby.dev/env-vars
"x-hasura-admin-secret": process.env.HASURA_API_TOKEN,
},
},
},
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
resolve: `gatsby-plugin-typesense`,
options: {
publicDir: `./public`, // Required
collectionSchema: {
// Required
name: "pages_v1",
fields: [
{
name: "title",
type: "string",
},
{
name: "description",
type: "string",
},
{
name: "typeData",
type: "string",
optional: true,
facet: true,
},
{
name: "thumbnail",
type: "string",
optional: true,
},
{
name: "tags",
type: "string[]",
optional: true,
facet: true,
},
{
name: "page_path", // Required
type: "string",
},
{
name: "page_priority_score", // Required
type: "int32",
},
],
default_sorting_field: "page_priority_score", // Required
},
server: {
// Required
apiKey: process.env.TYPESENSE_API_TOKEN,
nodes: [
{
protocol:
process.env.PROJECT_INTERNAL_PROTOCOL ||
process.env.PROJECT_PROTOCOL,
host:
process.env.PROJECT_INTERNAL_HOST || process.env.PROJECT_HOST,
port:
process.env.PROJECT_INTERNAL_PORT || process.env.PROJECT_PORT,
path: process.env.TYPESENSE_API_PATH || "/search/",
},
],
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
};