From de486f8b56d62a28a165f593092b22c9a33b101d Mon Sep 17 00:00:00 2001 From: Benjamin Cabanes <3447705+bcabanes@users.noreply.github.com> Date: Thu, 6 Jan 2022 12:40:01 -0500 Subject: [PATCH] docs(nxdev): temporary image path fix before docs flattening (#8408) --- .../src/lib/renderers/transform-image-path.spec.ts | 2 +- .../src/lib/renderers/transform-image-path.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/nx-dev/feature-doc-viewer/src/lib/renderers/transform-image-path.spec.ts b/nx-dev/feature-doc-viewer/src/lib/renderers/transform-image-path.spec.ts index 691184848150e..96ccfcc618c17 100644 --- a/nx-dev/feature-doc-viewer/src/lib/renderers/transform-image-path.spec.ts +++ b/nx-dev/feature-doc-viewer/src/lib/renderers/transform-image-path.spec.ts @@ -45,7 +45,7 @@ describe('transformImagePath', () => { const transform = transformImagePath(opts); expect(transform('/shared/test.png')).toEqual( - '/documentation/shared/test.png' + '/documentation/latest/shared/test.png' ); }); }); diff --git a/nx-dev/feature-doc-viewer/src/lib/renderers/transform-image-path.ts b/nx-dev/feature-doc-viewer/src/lib/renderers/transform-image-path.ts index a4f99b1eea9d5..21b806a01337e 100644 --- a/nx-dev/feature-doc-viewer/src/lib/renderers/transform-image-path.ts +++ b/nx-dev/feature-doc-viewer/src/lib/renderers/transform-image-path.ts @@ -1,8 +1,5 @@ import { uriTransformer } from 'react-markdown'; -import { - DocumentData, - VersionMetadata, -} from '@nrwl/nx-dev/data-access-documents'; +import { DocumentData } from '@nrwl/nx-dev/data-access-documents'; import { join } from 'path'; export function transformImagePath({ @@ -23,6 +20,7 @@ export function transformImagePath({ ); } - return uriTransformer(`/documentation`.concat(src)); + // TODO@ben remove `latest` when flattening docs' architecture + return uriTransformer(`/documentation/latest`.concat(src)); }; }