Add comments about changes, improve config file support of multi author

This commit is contained in:
Corbin Crutchley
2019-09-11 15:15:41 -07:00
parent fc64391ccf
commit 5236d35964
7 changed files with 2947 additions and 1297 deletions

View File

@@ -5,7 +5,8 @@
published: '2020-06-29T22:12:03.284Z',
authors: ['test1', 'test2'],
tags: ['announcements'],
attached: []
attached: [],
license: 'publicdomain-zero-1'
}
---

View File

@@ -133,7 +133,17 @@ module.exports = {
url: nodeUrl,
guid: nodeUrl,
custom_elements: [
{"dc:creator": frontmatter.authors.name }, //changed
/**
* We chose `dc:creator` in order to avoid having
* to list contact information from our contributors,
* as `dc:creator`
*
* FIXME: This does not have the functionality we'd expect
* it only lists the last author's name
*
* @see https://github.com/dylang/node-rss/issues/92
*/
{"dc:creator": frontmatter.authors.map(author => author.name) },
{comments: `${nodeUrl}#disqus_thread`}
],
}})
@@ -198,7 +208,7 @@ module.exports = {
{
name: "en",
// A function for filtering nodes. () => true by default
filterNodes: node => !!node.frontmatter && !!node.frontmatter.authors, //changed
filterNodes: node => !!node.frontmatter && !!node.frontmatter.authors,
},
],
// Fields to index. If store === true value will be stored in index file.
@@ -226,7 +236,14 @@ module.exports = {
excerpt: node => node.excerpt,
description: node => node.frontmatter.description,
slug: node => node.fields.slug,
authors: node => node.frontmatter.authors.name, //changed
/**
* FIXME: This does not work the way we'd want. We want the name
* the author rather than the username, but the node is not
* populated
*
* @see https://github.com/humanseelabs/gatsby-plugin-lunr/issues/24
*/
authors: node => node.frontmatter.authors.join(', '),
tags: node => node.frontmatter.tags,
},
},

4168
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,29 +11,29 @@
"classnames": "^2.2.6",
"css-loader": "^3.2.0",
"disqus-react": "^1.0.6",
"gatsby": "^2.13.76",
"gatsby-image": "^2.2.12",
"gatsby-plugin-feed": "^2.3.7",
"gatsby-plugin-google-analytics": "^2.1.9",
"gatsby": "^2.15.14",
"gatsby-image": "^2.2.18",
"gatsby-plugin-feed": "^2.3.12",
"gatsby-plugin-google-analytics": "^2.1.16",
"gatsby-plugin-lunr": "^1.5.2",
"gatsby-plugin-manifest": "^2.2.8",
"gatsby-plugin-offline": "^2.2.9",
"gatsby-plugin-manifest": "^2.2.16",
"gatsby-plugin-offline": "^3.0.6",
"gatsby-plugin-prefetch-google-fonts": "^1.4.3",
"gatsby-plugin-react-helmet": "^3.1.4",
"gatsby-plugin-react-helmet": "^3.1.7",
"gatsby-plugin-react-svg": "^2.1.2",
"gatsby-plugin-sass": "^2.1.11",
"gatsby-plugin-sharp": "^2.2.16",
"gatsby-plugin-sitemap": "^2.2.8",
"gatsby-plugin-transition-link": "^1.12.4",
"gatsby-remark-autolink-headers": "^2.1.6",
"gatsby-remark-copy-linked-files": "^2.1.9",
"gatsby-remark-images": "^3.1.16",
"gatsby-remark-prismjs": "^3.3.8",
"gatsby-remark-responsive-iframe": "^2.2.7",
"gatsby-source-filesystem": "^2.1.14",
"gatsby-transformer-json": "^2.2.4",
"gatsby-transformer-remark": "^2.6.18",
"gatsby-transformer-sharp": "^2.2.10",
"gatsby-plugin-sass": "^2.1.14",
"gatsby-plugin-sharp": "^2.2.21",
"gatsby-plugin-sitemap": "^2.2.12",
"gatsby-plugin-transition-link": "^1.13.0",
"gatsby-remark-autolink-headers": "^2.1.10",
"gatsby-remark-copy-linked-files": "^2.1.19",
"gatsby-remark-images": "^3.1.21",
"gatsby-remark-prismjs": "^3.3.13",
"gatsby-remark-responsive-iframe": "^2.2.16",
"gatsby-source-filesystem": "^2.1.22",
"gatsby-transformer-json": "^2.2.8",
"gatsby-transformer-remark": "^2.6.22",
"gatsby-transformer-sharp": "^2.2.14",
"node-sass": "^4.12.0",
"prismjs": "^1.17.1",
"react": "^16.9.0",
@@ -46,17 +46,17 @@
"@reach/router": "^1.1.1"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/core": "^7.6.0",
"@storybook/addon-actions": "^5.1.11",
"@storybook/addon-knobs": "^5.1.11",
"@storybook/addon-links": "^5.1.11",
"@storybook/addons": "^5.1.11",
"@storybook/react": "^5.1.11",
"@testing-library/jest-dom": "^4.1.0",
"@testing-library/react": "^9.1.3",
"@testing-library/react": "^9.1.4",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"babel-preset-gatsby": "^0.2.10",
"babel-preset-gatsby": "^0.2.13",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.9.0",
"jest-axe": "^3.2.0",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 9.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 9.4 MiB

View File

@@ -1,8 +1,6 @@
import {useState} from "react"
const {Query} = require('lunr');
function getSearchResults(query, lng, useQuery) {
function getSearchResults(query, lng) {
if (!query || !window.__LUNR__) return []
const lunrIndex = window.__LUNR__[lng]
// you can customize your search, see https://lunrjs.com/guides/searching.html