Skip to content

Commit

Permalink
Override page.versions for sample ui
Browse files Browse the repository at this point in the history
Specifying properties in the model for a specific page overrides the
ui-model.yml
  • Loading branch information
rwinch committed Nov 13, 2024
1 parent 086bd44 commit 3427e61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gulp.d/tasks/build-preview-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '_')
Expand Down
5 changes: 5 additions & 0 deletions preview-src/samples/edge-cases/index.adoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3427e61

Please sign in to comment.