Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit b206dbc

Browse files
author
dpatanin
committed
Merge branch 'gh-source' into feature/rework-navigation
2 parents 5a7cfeb + 8ec6b25 commit b206dbc

8 files changed

Lines changed: 310 additions & 128 deletions

File tree

gatsby-config.js

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ module.exports = {
88
siteMetadata: {
99
title: `secureCodeBox`,
1010
company: `iteratec GmbH`,
11-
description: '',
11+
description: "",
1212
// siteUrl: '',
1313
contact: {
14-
phone: '+49 89 614551-0',
15-
email: 'security@iteratec.com',
14+
phone: "+49 89 614551-0",
15+
email: "security@iteratec.com",
1616
},
1717
menuLinks: [
1818
{
@@ -21,9 +21,9 @@ module.exports = {
2121
link: '/getStarted',
2222
},
2323
{
24-
name: 'Integrations',
24+
name: "Integrations",
2525
external: false,
26-
link: '/integrations',
26+
link: "/integrations",
2727
},
2828
],
2929
},
@@ -41,6 +41,21 @@ module.exports = {
4141
maxDepth: 6,
4242
},
4343
excerpt_separator: `<!-- end -->`,
44+
plugins: [
45+
{
46+
resolve: `gatsby-remark-highlight-code`,
47+
options: {
48+
terminal: "carbon",
49+
theme: "cobalt",
50+
},
51+
},
52+
{
53+
resolve: `gatsby-remark-autolink-headers`,
54+
options: {
55+
icon: `<svg aria-hidden="true" height="20" version="1.1" viewBox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>`,
56+
},
57+
},
58+
],
4459
},
4560
},
4661
{
@@ -62,29 +77,29 @@ module.exports = {
6277
{
6378
resolve: `gatsby-source-filesystem`,
6479
options: {
65-
name: 'src',
80+
name: "src",
6681
path: `${__dirname}/src/`,
6782
},
6883
},
6984
{
70-
resolve: 'gatsby-source-filesystem',
85+
resolve: "gatsby-source-filesystem",
7186
options: {
7287
path: `${__dirname}/src/pages`,
73-
name: 'pages',
88+
name: "pages",
7489
},
7590
},
7691
{
77-
resolve: 'gatsby-source-filesystem',
92+
resolve: "gatsby-source-filesystem",
7893
options: {
7994
path: `${__dirname}/src/data`,
80-
name: 'data',
95+
name: "data",
8196
},
8297
},
8398
{
84-
resolve: 'gatsby-source-filesystem',
99+
resolve: "gatsby-source-filesystem",
85100
options: {
86101
path: `${__dirname}/src/images`,
87-
name: 'images',
102+
name: "images",
88103
},
89104
},
90105
{

gatsby-node.js

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,38 @@ exports.createPages = ({ graphql, actions }) => {
2626
}
2727
`).then((result) => {
2828
result.data.git.edges.forEach(({ node }) => {
29-
const component = path.resolve('src/templates/doc.js');
30-
createPage({
31-
path: `getStarted/${node.frontmatter.path}`,
32-
component,
33-
context: {
34-
id: node.id,
35-
},
36-
});
37-
});
38-
result.data.git.edges.forEach(({ node }) => {
39-
const component = path.resolve('src/templates/integration.js');
40-
createPage({
41-
path: `integrations/${node.frontmatter.path}`,
42-
component,
43-
context: {
44-
id: node.id,
45-
},
46-
});
29+
let componentName = '';
30+
if (node.frontmatter.path) {
31+
// The path consists normally like "scanners/nmap" or "hook/persistence-elastic"
32+
componentName = node.frontmatter.path.split('/')[1];
33+
}
34+
35+
if (
36+
node.frontmatter.category === 'scanner' ||
37+
node.frontmatter.category === 'hook'
38+
) {
39+
const component = path.resolve('src/templates/integration.js');
40+
createPage({
41+
path: `integrations/${node.frontmatter.path}`,
42+
component,
43+
context: {
44+
id: node.id,
45+
exampleFilter: `/${componentName}/examples/`,
46+
},
47+
});
48+
} else if (
49+
node.frontmatter.category === 'develop' ||
50+
node.frontmatter.category === 'use'
51+
) {
52+
const component = path.resolve('src/templates/doc.js');
53+
createPage({
54+
path: `getStarted/${node.frontmatter.path}`,
55+
component,
56+
context: {
57+
id: node.id,
58+
},
59+
});
60+
}
4761
});
4862
resolve();
4963
})

0 commit comments

Comments
 (0)