-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgatsby-config.mjs
More file actions
71 lines (66 loc) · 2.09 KB
/
gatsby-config.mjs
File metadata and controls
71 lines (66 loc) · 2.09 KB
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
// import path from "path"
import dotenv from "dotenv"
import { dirname } from "path"
import { fileURLToPath } from "url"
// Load environment variables
dotenv.config({
path: `.env.${process.env.NODE_ENV || "development"}`,
})
// ESM-compatible __dirname
const __dirname = dirname(fileURLToPath(import.meta.url))
// Validate environment variables
if (!process.env.CONTENTFUL_SPACE_ID || !process.env.CONTENTFUL_ACCESS_TOKEN) {
console.warn(
"Warning: Contentful SPACE_ID and ACCESS_TOKEN are not set. Check your .env file."
)
}
export default {
flags: {
DEV_SSR: false,
FAST_DEV: false,
},
trailingSlash: "never", // Options: "always" | "never" | "ignore"
siteMetadata: {
siteUrl: process.env.SITE_URL || "https://gilbertaharo.com",
title: process.env.SITE_TITLE || "Gilberto Alejandro Haro Website",
author: process.env.AUTHOR || "Gilberto A Haro",
description:
process.env.SITE_DESCRIPTION ||
"Gilberto Alejandro Haro Website, Technologies and digital creator fueled by a passion for discovering optimizations using the latest frontend techniques.",
},
plugins: [
"gatsby-plugin-netlify",
{
resolve: "gatsby-source-contentful",
options: {
downloadLocal: true,
spaceId: process.env.CONTENTFUL_SPACE_ID,
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
host: process.env.CONTENTFUL_HOST || "cdn.contentful.com",
},
},
`gatsby-transformer-json`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/data/`,
name: `data`,
},
},
"gatsby-plugin-sharp",
"gatsby-plugin-image",
"gatsby-transformer-sharp",
"gatsby-plugin-vanilla-extract",
{
resolve: "gatsby-plugin-manifest",
options: {
name: process.env.MANIFEST_NAME || "Gatsby Contentful Homepage",
short_name: process.env.MANIFEST_SHORT_NAME || "Gatsby",
start_url: "/",
background_color: process.env.BG_COLOR || "#ffe491",
theme_color: process.env.THEME_COLOR || "#004ca3",
icon: "src/favicon.png",
},
},
],
}