Skip to content

Commit cc6f98b

Browse files
committed
Update how we build navigation and remove webpack
1 parent 198ac45 commit cc6f98b

File tree

4 files changed

+62
-33
lines changed

4 files changed

+62
-33
lines changed

buildNavigation.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
var nav = require('./build/gatsbyConfig.js');
21
const path = require('path');
32
const fs = require('node:fs');
43
// regex to find sections:
54
// subPages:((\s* .*)*)
6-
try {
7-
if(!nav) {
8-
throw new TypeError("Unable to get nav");
9-
}
105

11-
if(!nav.gatsbyConfig) {
12-
throw new TypeError("Gatsby config not defined");
13-
}
6+
const { siteMetadata, pathPrefix } = require('./gatsby-config.js');
147

15-
if(!nav.gatsbyConfig.pathPrefix) {
8+
try {
9+
if(!pathPrefix) {
1610
throw new TypeError("pathPrefix not found");
1711
}
1812

19-
console.log(nav.gatsbyConfig);
20-
const pathPrefix = nav.gatsbyConfig.pathPrefix;
21-
let siteMetadata = nav.gatsbyConfig.siteMetadata ? nav.gatsbyConfig.siteMetadata : {};
22-
23-
2413
let topNavMarkdown = ``;
2514
// TODO: prob need url fixer from gatsby theme
2615
// home link defines the first link defaults to Products
@@ -29,7 +18,7 @@ try {
2918
// siteMetadata.home
3019

3120
topNavMarkdown += `- pathPrefix:\n`;
32-
topNavMarkdown += ` - ${pathPrefix}:\n`;
21+
topNavMarkdown += ` - ${pathPrefix}\n`;
3322

3423
if (siteMetadata.home) {
3524
topNavMarkdown += '\n- home:\n';
@@ -75,15 +64,17 @@ try {
7564
topNavMarkdown += sideNavMarkdown;
7665
}
7766

78-
fs.writeFileSync(path.resolve(__dirname + '/src/pages/config.md'), topNavMarkdown);
67+
let configFilePath = path.resolve(__dirname + '/src/pages/config.md');
68+
fs.writeFileSync(configFilePath, topNavMarkdown);
69+
console.log(`Generated file: ${configFilePath}`);
70+
7971
} catch (err) {
8072
console.error(err);
8173
}
8274
// subpages menu should only appear on the subpages path
8375
// need to check paths to
8476
function buildSideNavRecursively(sideNav, depth) {
8577
let sideNavMarkdown = '';
86-
console.log(sideNav)
8778

8879
for (var k in sideNav) {
8980
let header = sideNav[k].header ? 'header' : '';

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
"@adobe/gatsby-theme-aio": "^4.14.4",
1616
"gatsby": "4.22.0",
1717
"react": "^17.0.2",
18-
"react-dom": "^17.0.2",
19-
"webpack": "^5.91.0",
20-
"webpack-cli": "^5.1.4"
18+
"react-dom": "^17.0.2"
2119
},
2220
"resolutions": {
2321
"sharp": "0.33.0",
@@ -34,7 +32,7 @@
3432
"clean": "gatsby clean",
3533
"test:links": "remark src/pages --quiet --frail",
3634
"lint": "docker run --rm -e RUN_LOCAL=true --env-file '.github/super-linter.env' -v \"$PWD\":/tmp/lint github/super-linter:slim-v4.10.1",
37-
"buildNavigation": "webpack --config webpack.config.js && node buildNavigation.js"
35+
"buildNavigation": "node buildNavigation.js"
3836
},
3937
"remarkConfig": {
4038
"plugins": [

src/pages/config.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
- pathPrefix:
2+
- /developer-console/docs/
3+
4+
- pages:
5+
- [Developer Console](/developer-console)
6+
- [Authentication Guide](guides/authentication/index.md)
7+
- [Documentation](guides/index.md)
8+
- [Support](support/index.md)
9+
10+
- subPages:
11+
- [Developer Console](guides/index.md)
12+
- [Getting Started](guides/getting-started.md)
13+
- [Projects](guides/projects/index.md)
14+
- [Create an Empty Project](guides/projects/projects-empty.md)
15+
- [Create a Templated Project](guides/projects/projects-template.md)
16+
- [Projects Approval](guides/projects/approval.md)
17+
- [Beta Users](guides/projects/beta-users.md)
18+
- [Plugins](guides/plugins/index.md)
19+
- [Distribute a Plugin](guides/plugins/plugin-distribution.md)
20+
- [Update a Plugin](guides/plugins/plugin-update.md)
21+
- [Services](guides/services/index.md)
22+
- [Add API using OAuth Server-to-Server credential](guides/services/services-add-api-oauth-s2s.md)
23+
- [Add API using API Key credential](guides/services/services-add-api-key.md)
24+
- [Add API using OAuth User authentication credential](guides/services/services-add-api-oauth-user-authentication.md)
25+
- [Add Events](guides/services/services-add-event.md)
26+
- [Enable Runtime](guides/services/services-enable-runtime.md)
27+
- [Email Alerts](guides/email-alerts/index.md)
28+
- [Certificate Expiry](guides/email-alerts/cert-expiry.md)
29+
- [Credentials](guides/credentials.md)
30+
- [Insights](guides/insights.md)
31+
- [APIs and services](guides/apis-and-services.md)
32+
- [Public Profile](guides/public-profile.md)
33+
- [Quota](guides/quota.md)
34+
- [Authentication](guides/authentication/index.md)
35+
- [User Authentication](guides/authentication/UserAuthentication/index.md)
36+
- [Implementation Guide](guides/authentication/UserAuthentication/implementation.md)
37+
- [API Reference](guides/authentication/UserAuthentication/IMS.md)
38+
- [Server to Server Authentication](guides/authentication/ServerToServerAuthentication/index.md)
39+
- [Implementation Guide](guides/authentication/ServerToServerAuthentication/implementation.md)
40+
- [Migration Guide](guides/authentication/ServerToServerAuthentication/migration.md)
41+
- [Migration FAQs](guides/authentication/ServerToServerAuthentication/faqs.md)
42+
- [API Reference](guides/authentication/ServerToServerAuthentication/IMS.md)
43+
- [Service Account (JWT) credential](guides/authentication/JWT/index.md)
44+
- [Create a Public Key Certificate](guides/authentication/JWT/JWTCertificate.md)
45+
- [JWT Metascopes](guides/authentication/JWT/Scopes.md)
46+
- [JWT Sample Code](guides/authentication/JWT/samples.md)
47+
- [API Key Authentication](guides/authentication/APIKeyAuthentication/index.md)
48+
- [Tools](guides/authentication/Tools/index.md)
49+
- [OAuth 2.0 Playground](guides/authentication/Tools/OAuthPlayground.md)
50+
- [Postman](guides/authentication/Tools/Postman.md)
51+
- [Support](support/index.md)
52+
- [FAQ](support/faq.md)

webpack.config.js

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

0 commit comments

Comments
 (0)