forked from keycap-archivist/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
102 lines (100 loc) · 2.64 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
97
98
99
100
101
102
const plugins = [
{
resolve: 'gatsby-plugin-google-analytics',
options: {
trackingId: 'UA-169271859-1',
head: false,
anonymize: true,
},
},
'gatsby-plugin-next-seo',
{
resolve: 'gatsby-plugin-sitemap',
options: {
output: '/sitemap.xml',
query: `
{
allSitePage {
nodes {
path
}
}
}`,
resolveSiteUrl: () => 'https://keycap-archivist.com/',
serialize: ({ allSitePage }) =>
// Forced to due this because of Github pages default behaviour
// otherwise the server returns a 301 HTTP code.
allSitePage.nodes.map((node) => {
let url = node.path;
if (!node.path.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',
'gatsby-plugin-sass',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/assets/img`,
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
'gatsby-transformer-remark',
{
resolve: 'gatsby-plugin-web-font-loader',
options: {
google: {
families: ['Asap:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap'],
},
},
},
];
// Purge CSS for prod deployement
if (process.env.TARGET === 'PROD') {
plugins.push('gatsby-plugin-no-sourcemaps');
plugins.push({
resolve: 'gatsby-plugin-purgecss',
options: {
printRejected: true, // Print removed selectors and processed file names
develop: true, // Enable while using `gatsby develop`
tailwind: true, // Enable tailwindcss support
// whitelist: ['whitelist'], // Don't remove this selector
ignore: ['@fortawesome/fontawesome-svg-core/styles.css'], // Ignore files/folders
// purgeOnly : ['components/', '/main.css', 'bootstrap/'], // Purge only these files/folders
},
});
}
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,
};