Skip to content

fix(ui): map drop-style page URLs to markdown twins - #48

Merged
Tushar-TG-14 merged 2 commits into
tigergraph:mainfrom
ngarakapati:fix/page-actions-md-url
Aug 28, 2026
Merged

fix(ui): map drop-style page URLs to markdown twins#48
Tushar-TG-14 merged 2 commits into
tigergraph:mainfrom
ngarakapati:fix/page-actions-md-url

Conversation

@ngarakapati

Copy link
Copy Markdown
Contributor

Summary

Copy page / View as Markdown / Open in ChatGPT·Claude·Cursor all look up a .md twin by swapping .html.md.

Production docs omit .html (/savanna/main/overview/), so the button currently gets data-md-url="./" and fetches the HTML page.

This updates md-url so both URL styles work:

  • /overview/index.html/overview/index.md
  • /overview//overview/index.md
  • /overview/pricing/overview/pricing.md

build/ui-bundle.zip is rebuilt with the helper.

Merge order

Merge this PR first, then the companion change on cloud-docs#171 (htmlToMdUrl in lib/llm-utils.js) so the published .md paths match what the button fetches.

Based on current main after #47, so no rebase conflict with that merge.

Copy page and the LLM actions looked for .html → .md. Production pages
omit .html, so the button fetched the HTML page instead of index.md.
@Tushar-TG-14

Copy link
Copy Markdown
Collaborator

@ngarakapati
Could we add unit tests for md-url.js covering the three URL styles mentioned in the PR description, along with query strings/hash fragments? Since this helper is now used by Copy page / View as Markdown / ChatGPT / Claude / Cursor, having explicit tests would help prevent regressions in URL generation.

Can we confirm that query parameters and hash fragments are preserved correctly for the new URL styles? For example, /overview/?foo=bar should resolve to /overview/index.md?foo=bar, and /overview/index.html#section to /overview/index.md#section. A unit test for these cases would make this explicit.

Has the rebuilt build/ui-bundle.zip been generated from the exact final version of src/helpers/md-url.js, and has the updated bundle been tested in the Cloud/Savanna preview?

Add a node assert suite for the three page URL styles and for
preserving ?query and #hash, and wire it to npm test.
@ngarakapati

Copy link
Copy Markdown
Contributor Author

Added unit tests for md-url.js (npm test / node test/helpers/md-url-test.js). They cover the three URL styles from the PR, plus query strings and hashes, including:

  • /overview/?foo=bar/overview/index.md?foo=bar
  • /overview/index.html#section/overview/index.md#section
  • /overview/index.html?foo=bar#section/overview/index.md?foo=bar#section

Query and hash are preserved on all three styles. 15 cases, all passing.

Rebuilt build/ui-bundle.zip from this same src/helpers/md-url.js. Unzipping the helper out of the zip matches the source file. I also ran the packed helper through the page-actions template the way Antora would: Savanna drop-style URLs get data-md-url="index.md", and ?foo=bar / #section stay on that URL.

@Tushar-TG-14
Tushar-TG-14 merged commit 0d39f5d into tigergraph:main Aug 28, 2026
1 check failed
ngarakapati added a commit to ngarakapati/cloud-docs that referenced this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants