-
Notifications
You must be signed in to change notification settings - Fork 15
/
gatsby-config.js
96 lines (94 loc) · 2.24 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
const plugins = [
{
resolve: 'gatsby-plugin-google-analytics',
options: {
trackingId: 'UA-169271859-1',
head: false,
anonymize: true,
},
},
'gatsby-plugin-pnpm',
'gatsby-plugin-next-seo',
{
resolve: 'gatsby-plugin-sitemap',
options: {
output: '/sitemap.xml',
query: `
{
allSitePage {
nodes {
path
}
}
}`,
resolveSiteUrl: () => 'https://keycap-archivist.com/',
serialize: ({ path }) => {
// Forced to due this because of Github pages default behaviour
// otherwise the server returns a 301 HTTP code.
let url = path;
if (!url.endsWith('/')) {
url += '/';
}
return {
url: `https://keycap-archivist.com${url}`,
changefreq: 'daily',
priority: 0.7,
};
},
},
},
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: 'https://keycap-archivist.com/',
sitemap: 'https://keycap-archivist.com/sitemap.xml',
policy: [{ userAgent: '*', allow: '/' }],
},
},
{
resolve: 'gatsby-plugin-canonical-urls',
options: {
siteUrl: 'https://keycap-archivist.com/',
},
},
'gatsby-plugin-postcss',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/assets/img`,
},
},
'gatsby-plugin-image',
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
'gatsby-transformer-remark',
{
resolve: 'gatsby-omni-font-loader',
options: {
enableListener: true,
preconnect: ['https://fonts.googleapis.com', 'https://fonts.gstatic.com'],
web: [
{
name: 'Inter',
file: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap',
},
],
},
},
];
// Purge CSS for prod deployement
if (process.env.TARGET === 'PROD') {
plugins.push('gatsby-plugin-no-sourcemaps');
}
module.exports = {
pathPrefix: '/',
siteMetadata: {
title: 'Keycap Archivist',
description: 'The community driven artisan mechanical keyboard keycap catalog',
author: '@keycap-archivist',
siteUrl: 'https://keycap-archivist.com/',
generationDate: new Date(),
},
plugins,
};