Skip to content

Commit 239a3cf

Browse files
committed
feat: update editUrl for preview pages to point to the GitHub repository
1 parent 6ef657a commit 239a3cf

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

gulp.d/tasks/build-preview-pages.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
5959
uiModel.page.layout = doc.getAttribute('page-layout', 'default')
6060
uiModel.page.title = doc.getDocumentTitle()
6161
uiModel.page.contents = Buffer.from(doc.convert())
62+
63+
// Set a meaningful editUrl for preview pages that points to the actual GitHub repo
64+
const relativePath = path.relative(previewSrc, file.path)
65+
uiModel.page.editUrl = `https://github.com/microprofile/microprofile-tutorial-ui/edit/main/preview-src/${relativePath}`
6266
}
6367
file.extname = '.html'
6468
try {

preview-src/ui-model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ page:
6363
displayVersion: '5.2'
6464
module: ROOT
6565
relativeSrcPath: index.adoc
66-
editUrl: http://example.com/project-xyz/blob/main/index.adoc
66+
editUrl: https://github.com/microprofile/microprofile-tutorial-ui/edit/main/preview-src/index.adoc
6767
origin:
6868
private: false
6969
previous:

src/static/favicon.ico

-31.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)