Newer
Older
require("dotenv").config()
const PF_DOMAIN = process.env.PF_DOMAIN || "demo.onegeosuite.fr"
const PF_PROTOCOL = process.env.PF_PROTOCOL || "https"
const PF_PORT = process.env.PF_PORT || 443
const PF_URL =
PF_PORT != 443 && PF_PORT != 80
? PF_PROTOCOL + "://" + PF_DOMAIN + ":" + PF_PORT
: PF_PROTOCOL + "://" + PF_DOMAIN
console.log("Portal URL = ", PF_URL)
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",
"DIRECTUS_URL",
"DIRECTUS_ASSETS_URL",
{
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: "@onegeo-suite/gatsby-source-directus",
url: process.env.DIRECTUS_URL || PF_URL + "/directus/",
auth: {
token: process.env.DIRECTUS_TOKEN,
},
},
},
/*
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
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`,
],
developMiddleware: (app) => {
app.use(
"/geoportal/",
proxy.createProxyMiddleware("/geoportal/", {
target: PF_URL,