mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-26 11:49:04 +01:00
search fix
This commit is contained in:
parent
fc38c6b889
commit
af60744e9e
@ -91,22 +91,18 @@ module.exports = {
|
|||||||
// Attributes for custom indexing logic. See https://lunrjs.com/docs/lunr.Builder.html for details
|
// Attributes for custom indexing logic. See https://lunrjs.com/docs/lunr.Builder.html for details
|
||||||
fields: [
|
fields: [
|
||||||
{ name: 'title', store: true, attributes: { boost: 20 } },
|
{ name: 'title', store: true, attributes: { boost: 20 } },
|
||||||
{ name: 'content' },
|
|
||||||
{ name: 'excerpt', attributes: { boost: 10 } },
|
{ name: 'excerpt', attributes: { boost: 10 } },
|
||||||
{ name: 'category', store: true, attributes: { boost: 5 } },
|
{ name: 'tags', store: true, attributes: { boost: 5 } },
|
||||||
{ name: 'tags', store: true },
|
{ name: 'content' }
|
||||||
{ name: 'url', store: true }
|
|
||||||
],
|
],
|
||||||
// How to resolve each field's value for a supported node type
|
// How to resolve each field's value for a supported node type
|
||||||
resolvers: {
|
resolvers: {
|
||||||
// For any node of type MarkdownRemark, list how to resolve the fields' values
|
// For any node of type MarkdownRemark, list how to resolve the fields' values
|
||||||
MarkdownRemark: {
|
MarkdownRemark: {
|
||||||
title: node => node.frontmatter.title,
|
title: node => node.frontmatter.title,
|
||||||
content: node => node.rawMarkdownBody,
|
excerpt: node => node.excerpt,
|
||||||
excerpt: node => node.frontmatter.excerpt,
|
|
||||||
category: node => node.frontmatter.category,
|
|
||||||
tags: node => node.frontmatter.tags,
|
tags: node => node.frontmatter.tags,
|
||||||
url: node => node.fields.slug
|
content: node => node.rawMarkdownBody
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user