-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgatsby-config.js
More file actions
138 lines (138 loc) · 5.52 KB
/
gatsby-config.js
File metadata and controls
138 lines (138 loc) · 5.52 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
module.exports = {
siteMetadata: {
title: `ByteBandits`,
description: `Hide yo' bytes, hide yo' bits, or be pwn'd by ByteBandits! We are a team of hackers and geeks with our roots from IIT Indore, we solve CTF problems and write writeups for them.`,
author: `ByteBandits`,
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/icon.jpg`, // This path is relative to the root of the site.
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/writeups`,
name: `markdown-pages`,
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
pedantic: false,
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
// It's important to specify the maxWidth (in pixels) of
// the content container as this plugin uses this as the
// base for generating different widths of each image.
maxWidth: 720,
},
},
`gatsby-remark-copy-linked-files`
],
},
},
{
resolve: `@gatsby-contrib/gatsby-plugin-elasticlunr-search`,
options: {
// Fields to index
fields: [
`tags`,
`type`,
`tools`,
`techniques`,
`ctfName`,
`problemName`,
`author`,
// http://danhounshell.com/blog/tips-for-gatsby-elasticlunr-search-plugin/
// `body`
],
// 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: {
// http://danhounshell.com/blog/tips-for-gatsby-elasticlunr-search-plugin/
// body: node => node.rawMarkdownBody,
tags: node => {
let tags = node.rawMarkdownBody.split('\n').find(line => line.indexOf('[](tags=') !== -1)
return tags ? tags.substring(8, tags.length-1).split(',') : []
},
type: node => {
let tags = node.rawMarkdownBody.split('\n').find(line => line.indexOf('[](type=') !== -1)
return tags ? tags.substring(8, tags.length-1).split(',') : []
},
tools: node => {
let tags = node.rawMarkdownBody.split('\n').find(line => line.indexOf('[](tools=') !== -1)
return tags ? tags.substring(8, tags.length-1).split(',') : []
},
techniques: node => {
let tags = node.rawMarkdownBody.split('\n').find(line => line.indexOf('[](techniques=') !== -1)
return tags ? tags.substring(8, tags.length-1).split(',') : []
},
ctfName: node => {
let relativePath = node.fileAbsolutePath.substr(__dirname.length)
const srcLength = '/src/'.length
const readmeMDLength = '/README.md'.length
if (relativePath.substr(0, srcLength) === '/src/' && relativePath.substr(relativePath.length - readmeMDLength).toLowerCase() === '/readme.md') {
return ('/' + relativePath.substring(srcLength, relativePath.length - readmeMDLength)).split('/')[2]
}
},
problemName: node => {
let relativePath = node.fileAbsolutePath.substr(__dirname.length)
const srcLength = '/src/'.length
const readmeMDLength = '/README.md'.length
if (relativePath.substr(0, srcLength) === '/src/' && relativePath.substr(relativePath.length - readmeMDLength).toLowerCase() === '/readme.md') {
return ('/' + relativePath.substring(srcLength, relativePath.length - readmeMDLength)).split('/')[4]
}
},
author: node => {
let relativePath = node.fileAbsolutePath.substr(__dirname.length)
const srcLength = '/src/'.length
const readmeMDLength = '/README.md'.length
if (relativePath.substr(0, srcLength) === '/src/' && relativePath.substr(relativePath.length - readmeMDLength).toLowerCase() === '/readme.md') {
return ('/' + relativePath.substring(srcLength, relativePath.length - readmeMDLength)).split('/')[5]
}
},
path: node => {
let relativePath = node.fileAbsolutePath.substr(__dirname.length)
const srcLength = '/src/'.length
const readmeMDLength = '/README.md'.length
if (relativePath.substr(0, srcLength) === '/src/' && relativePath.substr(relativePath.length - readmeMDLength).toLowerCase() === '/readme.md') {
return relativePath.substring(srcLength, relativePath.length - readmeMDLength)
}
}
},
},
},
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "UA-136974496-1",
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.app/offline
// 'gatsby-plugin-offline',
],
}