forked from Xposed-Modules-Repo/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
117 lines (116 loc) · 3.13 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
105
106
107
108
109
110
111
112
113
114
115
116
117
const flexsearchConfig = require('./src/flexsearch-config')
module.exports = {
siteMetadata: {
title: 'Xposed Module Repository',
siteUrl: 'https://modules.lsposed.org',
description: 'New Xposed Module Repository',
author: 'https://github.com/Xposed-Modules-Repo/modules/graphs/contributors'
},
plugins: [
'gatsby-plugin-postcss',
'gatsby-plugin-stylus',
'gatsby-plugin-react-helmet',
'gatsby-plugin-sitemap',
'gatsby-plugin-sass',
'gatsby-plugin-material-ui',
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'Xposed Module Repository',
short_name: 'Xposed Module Repo',
start_url: '/',
background_color: '#1e88e5',
theme_color: '#1e88e5',
display: 'minimal-ui',
icon: 'src/images/favicon.png' // This path is relative to the root of the site.
}
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
'gatsby-remark-external-links'
]
}
},
{
resolve: 'gatsby-plugin-local-search',
options: {
name: 'repositories',
engine: 'flexsearch',
engineOptions: flexsearchConfig,
query: `
{
allGithubRepository(filter: {isModule: {eq: true}, hide: {eq: false}}) {
edges {
node {
name
description
collaborators {
edges {
node {
login
name
}
}
}
releases {
edges {
node {
description
}
}
}
readme
readmeHTML
childGitHubReadme {
childMarkdownRemark {
excerpt(pruneLength: 250, truncate: true)
}
}
summary
additionalAuthors {
name
}
}
}
}
}
`,
ref: 'name',
index: ['name', 'description', 'summary', 'readme', 'collaborators', 'additionalAuthors', 'release'],
store: ['name', 'description', 'summary', 'readmeExcerpt'],
normalizer: ({ data }) =>
data.allGithubRepository.edges.map(({ node: repo }) => ({
name: repo.name,
description: repo.description,
summary: repo.summary,
readme: repo.readme,
readmeExcerpt: repo.childGitHubReadme && repo.childGitHubReadme.childMarkdownRemark.excerpt,
release: repo.releases && repo.releases.edges.length &&
repo.releases.edges[0].node.description,
collaborators: repo.collaborators &&
repo.collaborators.edges.map(({ node: collaborator }) => `${collaborator.name} (@${collaborator.login})`)
.join(', '),
additionalAuthors: repo.additionalAuthors &&
repo.additionalAuthors.map((author) => author.name).join(', ')
}))
}
},
{
resolve: 'gatsby-plugin-nprogress',
options: {
color: '#eee',
showSpinner: false
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'pages',
path: './src/pages/'
},
__key: 'pages'
}
]
}