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

Commit 94ef910

Browse files
author
dpatanin
committed
link to remote docs
1 parent e9d80ae commit 94ef910

7 files changed

Lines changed: 47 additions & 65 deletions

File tree

gatsby-config.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,12 @@ module.exports = {
110110
path: `${__dirname}/.cache/gatsby-source-git/secureCodeBox-v2-alpha/hooks`,
111111
},
112112
},
113-
// TODO: when #76 merged
114-
// {
115-
// resolve: `gatsby-source-filesystem`,
116-
// options: {
117-
// name: `docs`,
118-
// path: `${__dirname}/.cache/gatsby-source-git/secureCodeBox-v2-alpha/docs`,
119-
// },
120-
// },
113+
{
114+
resolve: `gatsby-source-filesystem`,
115+
options: {
116+
name: `docs`,
117+
path: `${__dirname}/.cache/gatsby-source-git/secureCodeBox-v2-alpha/docs`,
118+
},
119+
},
121120
],
122121
};

gatsby-node.js

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
1-
const path = require("path");
2-
const fs = require("fs");
1+
const path = require('path');
2+
const fs = require('fs');
33

44
// Create pages from markdown files
55
exports.createPages = ({ graphql, actions }) => {
66
const { createPage } = actions;
7-
// TODO: Remove docs when #76 was merged & use docs template for git remote docs
87
return new Promise((resolve, reject) => {
98
resolve(
109
graphql(`
1110
{
12-
docs: allMarkdownRemark(
13-
filter: { fileAbsolutePath: { regex: "/docs/" } }
14-
sort: { fields: [frontmatter___date], order: DESC }
15-
) {
16-
edges {
17-
node {
18-
id
19-
frontmatter {
20-
path
21-
title
22-
}
23-
excerpt
24-
}
25-
}
26-
}
27-
scanner: allMarkdownRemark(
11+
git: allMarkdownRemark(
2812
filter: { fileAbsolutePath: { regex: "/gatsby-source-git/" } }
2913
) {
3014
edges {
@@ -40,25 +24,25 @@ exports.createPages = ({ graphql, actions }) => {
4024
}
4125
}
4226
}
43-
`).then(result => {
44-
result.data.docs.edges.forEach(({ node }) => {
45-
const component = path.resolve("src/templates/doc.js");
27+
`).then((result) => {
28+
result.data.git.edges.forEach(({ node }) => {
29+
const component = path.resolve('src/templates/doc.js');
4630
createPage({
47-
path: node.frontmatter.path,
31+
path: `getStarted/${node.frontmatter.path}`,
4832
component,
4933
context: {
50-
id: node.id
51-
}
34+
id: node.id,
35+
},
5236
});
5337
});
54-
result.data.scanner.edges.forEach(({ node }) => {
55-
const component = path.resolve("src/templates/integration.js");
38+
result.data.git.edges.forEach(({ node }) => {
39+
const component = path.resolve('src/templates/integration.js');
5640
createPage({
5741
path: `integrations/${node.frontmatter.path}`,
5842
component,
5943
context: {
60-
id: node.id
61-
}
44+
id: node.id,
45+
},
6246
});
6347
});
6448
resolve();
@@ -70,11 +54,18 @@ exports.createPages = ({ graphql, actions }) => {
7054
exports.onCreateNode = ({ node, actions }) => {
7155
const { createNodeField } = actions;
7256

73-
if (node.internal.type === `File` && (node.base === `scan.yaml` || node.base === `findings.yaml`)) {
57+
if (
58+
node.internal.type === `File` &&
59+
(node.base === `scan.yaml` || node.base === `findings.yaml`)
60+
) {
7461
fs.readFile(node.absolutePath, undefined, (_err, buf) => {
7562
createNodeField({ node, name: `content`, value: buf.toString() });
7663
});
7764
createNodeField({ node, name: `fileName`, value: node.base });
78-
createNodeField({ node, name: `scanTarget`, value: node.relativeDirectory.split('/examples/')[1] });
65+
createNodeField({
66+
node,
67+
name: `scanTarget`,
68+
value: node.relativeDirectory.split('/examples/')[1],
69+
});
7970
}
80-
}
71+
};

src/pages/docs/devGuide.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/pages/docs/userGuide.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/pages/getStarted/index.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from 'react';
2-
import { graphql, Link } from 'gatsby';
2+
import { graphql, Link, withPrefix } from 'gatsby';
33
import SEO from '../../components/SEO';
44
import Layout from '../../components/Layout';
55
import Img from 'gatsby-image';
66

77
const GetStarted = (props) => {
8-
const docs = props.data.ServicesQuery.edges;
8+
const docs = props.data.ServicesQuery.edges.filter(function(doc) {
9+
return doc.node.frontmatter.path !== null;
10+
});
911
return (
1012
<Layout bodyClass="page-getStarted">
1113
<SEO title="Services" />
@@ -46,7 +48,17 @@ const GetStarted = (props) => {
4648
{docs.map((doc, index) => (
4749
<Link key={index} to={doc.node.frontmatter.path}>
4850
<div className="feature hoverable">
49-
<h1>{doc.node.frontmatter.title}</h1>
51+
<div className="feature-image">
52+
<img
53+
src={withPrefix(
54+
`/features/${doc.node.frontmatter.title}.svg`
55+
)}
56+
alt={doc.node.frontmatter.title}
57+
/>
58+
</div>
59+
<h2 className="feature-title">
60+
{doc.node.frontmatter.title}
61+
</h2>
5062
</div>
5163
</Link>
5264
))}
Lines changed: 1 addition & 0 deletions
Loading

static/features/User Guide.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)