Conversation
Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
…aths Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
…ript Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
|
bronius
left a comment
There was a problem hiding this comment.
Something else is wrong. The build deployed to the PR subfolder lacks at least an index.html.
Determine why there is no index.html built and what else might also, therefore, be missing, and make sure the build or deploy process ships it. In the end, the /pr-preview/ID subfolder should be a completely self-standing website.
|
@copilot Actually - - I am looking at hte preview again now, and it is working exactly as expected. Will review in the main review. |
bronius
left a comment
There was a problem hiding this comment.
Excellent. Now, pore over the site contents in unprocessed markdown for links that are relative that will break. One such example is the link around "GitHub Migration" in the text
See GitHub Migration for information about how repos were migrated from
on the page that renders as:
https://docs.cloud.tamu.edu/pr-preview/pr-53/github/index.html
currently renders to link:
https://docs.cloud.tamu.edu/pr-preview/pr-53/migrating.html (404)
but should instead link:
https://docs.cloud.tamu.edu/pr-preview/pr-53/github/migrating.html
|
@copilot please see my comment above and address it |
…base-url.sh Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
Fixed in commit 12c0746. The issue was that the script wasn't correctly handling relative links in subdirectories. Changes made:
The specific case you mentioned now works correctly:
Addressed in commit 12c0746 - see my response to your previous comment. |
Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
Fixed in commit 2bc448f. The issue was that Changes made:
Now
This should work in both PR preview (with paths prefixed) and production (without prefix - script not run). |
Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…l as root link Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
…ute in JavaScript Co-authored-by: bronius <2348390+bronius@users.noreply.github.com>
|
This looks so good: Local
And now we can handle our inter-document crosslinks more reliably as well. |
pjw1630
left a comment
There was a problem hiding this comment.
As Skippy would say, "Trust...the awesomeness."
bronius
left a comment
There was a problem hiding this comment.
(copy/pasting my "review" as a "review" to properly dismiss my earlier rejection..so sensitive..)
This looks so good: Local mdbook serve all things work, and PR Preview https://docs.cloud.tamu.edu/pr-preview/pr-53 all things work:
Left sidebar nav links click
And expanded/active css classes are properly managed
And now we can handle our inter-document crosslinks more reliably as well.
PR Preview, Production, and Local Development Build Fix - Complete!
Issue Analysis
/pr-preview/pr-X/but relative asset/link paths don't work/mdbook servelocally also has broken navigation due to relative paths<base href>fromsite-url<base>tag approach doesn't work due to how mdBook generates pathsmigrating.htmllinking to wrong location)index.htmlinstead of site rootSolution Approach
mdbook serve, production, and PR previewinject-base-url.sh) runs for production/PR preview to add environment-specific path prefixes../../style paths from deep pages./style paths for images and assetscloud/index.html) and file-relative paths (migrating.html)index.htmlto always point to site root (fixes Home link)Implementation & Testing
theme/index.hbswith JavaScript that:index.html→/index.html,cloud/page.html→/cloud/page.html)/,http://,https://, or#)mdbook servewithout any post-build script or manual interventioninject-base-url.shfor production/PR preview that:/pr-preview/pr-X) for PR previews/for productionsrc/kion/features/getting_started.md.github/workflows/preview.ymlto run script with PR preview prefix.github/workflows/gh-pages.ymlto run script for production buildsNavigation Fix Details
mdBook 0.4.52 generates relative navigation links that break when navigating from subdirectories:
Problems:
toc.jsbut doesn't load it, so navigation is embedded in HTML without active/expanded logicindex.htmlfromcloud/page.htmlresolves tocloud/index.html(wrong - should be root)cloud/page.htmlfromcloud/other.htmlresolves tocloud/cloud/page.html(404)mdbook serve, production, and PR previewsSolution:
/prefix/pr-preview/pr-Xprefixmdbook servelocally (no scripts needed)/)/pr-preview/pr-X)Note: SUMMARY.md documentation in README.md remains unchanged and accurate. The solution works with mdBook's existing SUMMARY.md-based navigation structure without deviation.
All changes complete, tested, and simplified! Navigation works correctly in
mdbook serve, production, and PR preview environments without requiring developers to run any manual scripts.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.