Skip to content

Commit d3d47d1

Browse files
committed
fix(tools): replace permalink from manifest to match dev server subpath configuration
1 parent 22fd9be commit d3d47d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/pfe-tools/dev-server/config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ async function renderURL(context: Context, options: PfeDevServerInternalConfig):
7575
const demos = manifests
7676
.flatMap(manifest => manifest.getTagNames()
7777
.flatMap(tagName => manifest.getDemoMetadata(tagName, options as PfeDevServerInternalConfig)));
78+
/* Rewrite the permalink to match location of the dev server componentSubpath */
79+
demos.forEach(demo => {
80+
if (demo?.permalink) {
81+
demo.permalink = demo.permalink.replace(options.site.docsComponentSubpath, options.site.componentSubpath);
82+
}
83+
});
7884
const demo = demos.find(x => x.permalink === url.pathname);
7985
const manifest = demo?.manifest;
8086

0 commit comments

Comments
 (0)