vogievetsky commented on a change in pull request #8593: Website: stricter
replace
URL: https://github.com/apache/incubator-druid/pull/8593#discussion_r328350653
##########
File path: website/script/fix-path.js
##########
@@ -30,8 +30,8 @@ try {
// Fix doc paths
replace.sync({
files: './build/ApacheDruid/docs/**/*.html',
- from: /\/docs\//g,
- to: '/docs/' + urlVersion + '/',
+ from: /\/docs\/([^">]+\.html)/g,
Review comment:
This script 'fixes' the docs made by the Docusaurus build system to be
versioned as part of copying the docs into the website.
it used to look for all instances for the string `/docs/` and turn them into
`/docs/0.16.0-incubating/` this is pretty crude.
Now as it happens the git repo has links like this
`https://github.com/apache/incubator-druid/edit/master/docs/0.16.0-incubating/design/index.md`
So by coincidence the website and the github both have a `docs` directory.
This script would then rewrite the links generated by the `Edit` button
causing the bug.
In this fix I tightened up the matcher regexp to only look for links that
end in `.html`. This works because it just so happens that all the docs in GH
are `.md` and all the docs that are part of the website are `.html`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]