-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
104 lines (95 loc) · 4.18 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
103
104
module.exports = {
siteMetadata: {
title: 'Lupe Camacho',
siteUrl: 'https://lupecamacho.com',
description: 'My page on the Internet',
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-sass`,
{
resolve: 'gatsby-source-prismic',
options: {
repositoryName: 'headless-lupe',
// Set a link resolver function used to process links in your content.
// Fields with rich text formatting or links to internal content use this
// function to generate the correct link URL.
// The document node, field key (i.e. API ID), and field value are
// provided to the function, as seen below. This allows you to use
// different link resolver logic for each field if necessary.
// See: https://prismic.io/docs/javascript/query-the-api/link-resolving
linkResolver: ({ node, key, value }) => (doc) => {
// TODO: add additional doc types (minus homepage)
if (doc.type === 'post') return `/post/${doc.uid}`;
return `/doc/${doc.uid}`;
},
// Set a list of links to fetch and be made available in your link
// resolver function.
// See: https://prismic.io/docs/javascript/query-the-api/fetch-linked-document-fields
fetchLinks: [
// Your list of links
],
// Set an HTML serializer function used to process formatted content.
// Fields with rich text formatting use this function to generate the
// correct HTML.
// The document node, field key (i.e. API ID), and field value are
// provided to the function, as seen below. This allows you to use
// different HTML serializer logic for each field if necessary.
// See: https://prismic.io/docs/nodejs/beyond-the-api/html-serializer
htmlSerializer: ({ node, key, value }) => (
type,
element,
content,
children
) => {
// Your HTML serializer
},
schemas: {
post: require('./src/schemas/post.json'),
},
// Set a default language when fetching documents. The default value is
// '*' which will fetch all languages.
// See: https://prismic.io/docs/javascript/query-the-api/query-by-language
lang: '*',
// Add the Prismic Toolbar script to the site. Defaults to false.
// Set to "legacy" if your repository requires the older toolbar script.
// See: https://prismic.io/docs/rest-api/beyond-the-api/the-preview-feature
prismicToolbar: true,
// Set a function to determine if images are downloaded locally and made
// available for gatsby-transformer-sharp for use with gatsby-image.
// The document node, field key (i.e. API ID), and field value are
// provided to the function, as seen below. This allows you to use
// different logic for each field if necessary.
// This defaults to always return false.
shouldDownloadImage: ({ node, key, value }) => {
// Return true to download the image or false to skip.
},
// Provide a default set of Imgix image transformations applied to
// Imgix-backed gatsby-image fields. These options will override the
// defaults set by Prismic.
// See: https://docs.imgix.com/apis/url
imageImgixParams: {
auto: 'compress,format',
fit: 'max',
q: 50,
},
// Provide a default set of Imgix image transformations applied to
// the placeholder images of Imgix-backed gatsby-image fields. These
// parameters will be applied over those provided in the above
// `imageImgixParams` option.
// See: https://docs.imgix.com/apis/url
imagePlaceholderImgixParams: {
w: 100,
blur: 15,
q: 50,
},
// Set the prefix for the filename where type paths for your schemas are
// stored. The filename will include the MD5 hash of your schemas after
// the prefix.
// This defaults to 'prismic-typepaths---${repositoryName}'.
typePathsFilenamePrefix:
'prismic-typepaths---gatsby-source-prismic-test-site',
},
},
],
};