Skip to content

Commit 31ab2c2

Browse files
committed
replace all dots in the step name with dashes
1 parent ff90c7b commit 31ab2c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/gatsby/onPostBuild.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ const parsePathSlug = (slug: string) => {
7373
/^\/(?<platform>[^/]+)\/performance-onboarding\/(?<sub_platform>[^/]+)\/(?<step>[^/]+)\/$/
7474
);
7575

76-
const { platform, sub_platform, step } = pathMatch.groups;
76+
const { platform, sub_platform } = pathMatch.groups;
77+
let { step } = pathMatch.groups;
78+
step = step.replaceAll(".", "-");
7779
let sub = `performance-onboarding-${sub_platform}-${step}`;
7880

7981
if (platform === pathMatch.groups.sub_platform) {
@@ -105,7 +107,7 @@ const writeJson = async (
105107
const platforms = [];
106108
const indexJson = {};
107109
nodes.forEach(node => {
108-
const {platform:main, sub} = parsePathSlug(node.fields.slug);
110+
const { platform: main, sub } = parsePathSlug(node.fields.slug);
109111

110112
if (!indexJson[main]) indexJson[main] = {};
111113
if (!node.frontmatter.doc_link) {

0 commit comments

Comments
 (0)