-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
51 lines (49 loc) · 1.6 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
const { isNil } = require('lodash')
const mapPagesUrls = {
index: '/',
history: '/history',
info: '/info',
}
module.exports = {
siteMetadata: {
title: 'Demo',
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-transformer-remark',
{
resolve: 'gatsby-plugin-lunr',
options: {
// ISO 639-1 language codes. See https://lunrjs.com/guides/language_support.html for details
languages: ['de'],
// Fields to index. If store === true value will be stored in index file.
// Attributes for custom indexing logic. See https://lunrjs.com/docs/lunr.Builder.html for details
fields: [
{ name: 'title', store: true, attributes: { boost: 20 } },
{ name: 'description', store: true },
{ name: 'content', store: true },
{ name: 'url', store: true },
],
// A function for filtering nodes. () => true by default
filterNodes: (node) => !isNil(node.frontmatter),
// How to resolve each field's value for a supported node type
resolvers: {
// For any node of type MarkdownRemark, list how to resolve the fields' values
MarkdownRemark: {
title: (node) => node.frontmatter.title,
description: (node) => node.frontmatter.description,
content: (node) => node.rawMarkdownBody,
url: (node) => mapPagesUrls[node.frontmatter.templateKey],
},
},
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'src',
path: `${__dirname}/src/data/`,
},
},
],
}