From 3427e61078ca28389882472134177d9144d3bebf Mon Sep 17 00:00:00 2001 From: Rob Winch <362503+rwinch@users.noreply.github.com> Date: Tue, 12 Nov 2024 22:26:55 -0600 Subject: [PATCH] Override page.versions for sample ui Specifying properties in the model for a specific page overrides the ui-model.yml --- gulp.d/tasks/build-preview-pages.js | 2 +- preview-src/samples/edge-cases/index.adoc.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gulp.d/tasks/build-preview-pages.js b/gulp.d/tasks/build-preview-pages.js index 8cbae9a..6cb3659 100644 --- a/gulp.d/tasks/build-preview-pages.js +++ b/gulp.d/tasks/build-preview-pages.js @@ -50,7 +50,7 @@ module.exports = const siteRootPath = path.relative(ospath.dirname(file.path), ospath.resolve(previewSrc)) const uiModel = { ...baseUiModel } const sharedPageModel = page.component ? baseUiModel.shared[page.component.name][page.version] : {} - uiModel.page = { ...uiModel.page, ...page, ...sharedPageModel } + uiModel.page = { ...uiModel.page, ...sharedPageModel, ...page } uiModel.siteRootPath = siteRootPath uiModel.siteRootUrl = path.join(siteRootPath, 'index.html') uiModel.uiRootPath = path.join(siteRootPath, '_') diff --git a/preview-src/samples/edge-cases/index.adoc.yml b/preview-src/samples/edge-cases/index.adoc.yml index 5cfe965..318e13c 100644 --- a/preview-src/samples/edge-cases/index.adoc.yml +++ b/preview-src/samples/edge-cases/index.adoc.yml @@ -25,3 +25,8 @@ breadcrumbs: - content: Edge cases url: '#' urlType: fragment +versions: + - url: '#/samples/edge-cases.html' + displayVersion: 2.0.0 + - url: '#/1.0.0/samples/edge-cases.html' + displayVersion: 1.0.0