Point download entry points at artifacts instead of descriptions - #482
Conversation
20f7c8e to
44d6627
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates documentation and link-rewrite tooling so “install/download Avocado CLI/Desktop” links resolve to actual acquisition pages (installation/downloads) instead of overview/prose pages, and avoids 404s from the retired /guides/ prefix.
Changes:
- Update various docs/components to link to Avocado CLI installation and peridio.com Downloads anchors.
- Add a sync-time rewrite pass to repoint absolute
https://docs.peridio.com/...acquisition links (including retired/guides/URLs). - Update a Docusaurus redirect so the old “download” path lands on the CLI installation page.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/src/components/shared/HostPrerequisites.tsx | Updates prereq links to CLI installation and peridio.com download anchors; adds Downloads note. |
| src/scripts/sync-references.js | Adds rewrite rules for absolute acquisition links during reference sync. |
| src/docusaurus.config.js | Redirects old download path to CLI installation and clarifies rationale in comments. |
| src/docs-overview/avocado-desktop/overview.mdx | Updates Desktop download CTA links to peridio.com Downloads. |
| src/docs-guides/mcp/installation.md | Points MCP prereq to CLI installation + Getting Started. |
| src/docs-guides/getting-started/index.mdx | Adjusts Desktop CTA label copy. |
| src/docs-guides/avocado-cli/overview.md | Adds a tip directing readers to installation/downloads. |
| src/docs-guides/avocado-cli/installation.md | Adds Downloads option + Desktop bundle note. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/scripts/sync-references.js:132
- These rewrites won’t match common URL variants like a trailing slash (e.g.
/overview/) or the no-trailing-slash prefix form (e.g.https://docs.peridio.com/guideswithout the final/). Since the intent is to prevent 404s in generated references, the regexes should tolerate those variants (e.g., make the trailing slash optional and match both prefix forms) so the rewrite is reliably applied.
const ACQUISITION_REWRITES = [
{
from: /https:\/\/docs\.peridio\.com\/guides\//g,
to: 'https://docs.peridio.com/developer-reference/',
},
{
from: /https:\/\/docs\.peridio\.com\/developer-reference\/avocado-cli\/overview/g,
to: 'https://docs.peridio.com/developer-reference/avocado-cli/installation',
},
]
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/scripts/sync-references.js:144
- This duplicates the same fenced-code segmentation approach used in
rewriteRelativeLinks, and then adds another layer of bespoke capture-group interpolation. Consider extracting a shared helper that applies a list of rewrite rules only to non-fenced segments (so both functions share the same implementation), and representtoas either a native replacement string (letting JS handle$1etc.) or as a(match, ...groups) => stringfunction to avoid the manual$ninterpolation logic.
function rewriteAcquisitionLinks(body) {
let count = 0
// Same fenced-code split as rewriteRelativeLinks: a URL shown inside an
// example is being quoted, not offered as a link to follow.
const segments = body.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/g)
src/scripts/sync-references.js:138
- The first rewrite only matches when the absolute prefix includes a trailing slash (e.g.
.../developer-reference/). If any generated content containshttps://docs.peridio.com/developer-reference(no trailing slash) before a path delimiter, it won’t be rewritten and may leave a broken absolute link behind. Adjust the regex to also match the no-trailing-slash form (while preserving correct path joining) so the repointing is complete.
const ACQUISITION_REWRITES = [
{
from: /https:\/\/docs\.peridio\.com\/(?:guides|developer-reference)\//g,
to: '/developer-reference/',
},
{
from: /\/developer-reference\/avocado-cli\/overview\/?([?#][^)\s]*)?(?=[)\s]|$)/g,
to: '/developer-reference/avocado-cli/installation$1',
},
]
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (3)
src/scripts/sync-references.js:135
- The
overview → installationrewrite only triggers when the URL is followed by)/ whitespace / end-of-string. This misses common terminators like>(Markdown autolinks:<...>) and quotes (HTML:href=\"...\"), so some overview URLs may not be repointed. Consider broadening the lookahead to include>and quote delimiters so the rewrite applies in those contexts too.
from: /\/developer-reference\/avocado-cli\/overview\/?([?#][^)\s]*)?(?=[)\s]|$)/g,
to: '/developer-reference/avocado-cli/installation$1',
src/scripts/sync-references.js:174
acquisitionCountis incremented per regex match across all rules, so a single link can be counted multiple times (e.g., domain-prefix rewrite + overview→installation rewrite). This makes the log message ambiguous. Consider either logging per-rule counts, or adjust the message to clarify it’s counting 'matches/replacements' rather than distinct links.
const { body: repointed, count: acquisitionCount } = rewriteAcquisitionLinks(rewritten)
if (acquisitionCount > 0) {
console.log(` ${name}: applied ${acquisitionCount} acquisition rewrite(s)`)
}
src/scripts/sync-references.js:144
- This duplicates the fenced-code segmentation approach used elsewhere (notably
rewriteRelativeLinks). To avoid the two functions drifting (e.g., adding support for additional fence styles in one but not the other), consider extracting this segmentation into a shared helper and reuse it in both rewrite passes.
// Same fenced-code split as rewriteRelativeLinks: a URL shown inside an
// example is being quoted, not offered as a link to follow.
const segments = body.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/g)
Every "install the Avocado CLI" prerequisite on the getting-started surfaces linked to the CLI *overview* — a page that describes what the CLI does and offered no way to obtain it, not even an inline link to the install page. The Jetson guide was reported first, but the line is shared by QEMU, Raspberry Pi, and the Any-Supported-Target selector, and no page anywhere on the docs site linked to peridio.com/downloads at all. `HostPrerequisites` is the single component all four surfaces render, so that is where the fix lands: both CLI links now resolve to the installation page, "install Avocado Desktop" resolves to the download rather than the app's overview, and the artifact list is named alongside them. Fixing the component rather than the four call sites is also what keeps them from drifting apart again. The same defect reached 28 generated reference guides, where the link also used the retired `/guides/` path prefix and 404'd outright. Those files are gitignored build output produced by sync-references.js from avocado-linux/references, so editing them does not persist and we have read-only access upstream. The rewrite now happens in the sync script, next to the relative-link pass that exists for the same class of problem, so it survives every resync and lapses on its own if upstream is corrected. Also: - The retired `/developer-reference/getting-started/download` redirect pointed at the Desktop overview, so a URL named `download` landed on prose about the app. It now resolves to the CLI installation page. That redirect is the origin of this whole class of defect. - Desktop acquisition links moved from the old `/avocado-os#downloads` anchor to the dedicated `/downloads` page. - The CLI overview page now says where to get the CLI, so the links that legitimately point at it for description no longer dead-end. - The MCP prerequisite linked the CLI via the getting-started index; it now offers the install page directly. Left alone deliberately: the tool-choice links in provisioning.md and mcp/installation.md point at overview pages to say what a tool *is*, which is the right destination for that sentence — and both overviews now route onward to acquisition. Verified: docusaurus build passes strict broken-link checking, every prerequisite CLI link in the built output resolves to `installation` with none left on `overview`, and all four getting-started surfaces reach /downloads (any-target via the selector, on target selection). lint, typecheck, and format are clean. The peridio.com/downloads links 404 until peridio/apex#120 ships that page, so this must land after it.
…d rewrite the retired /guides/ prefix as a class. Co-authored-by: Cursor <cursoragent@cursor.com>
…agment, rewrite-count log. Co-authored-by: Cursor <cursoragent@cursor.com>
b9ccf87 to
cfca4c5
Compare
Fixes DES-312 — https://linear.app/peridio/issue/DES-312/fix-download-entry-points-that-resolve-to-descriptions-instead-of
The report
Both halves check out, and the pattern is wider than the one page.
Root cause
a3d4eaeretired the docs "Download & Install" page and redirected it to the Desktop overview. From then on a URL literally nameddownloadresolved to prose about the app, and the acquisition links in the guides were all written against overview pages.What was wrong
shared/HostPrerequisites.tsx×2/avocado-cli/overview— describes the CLI, offers no way to get it, not even an inline link to the install pageshared/HostPrerequisites.tsx/avocado-desktop/overviewreferences/*.mdxdocs.peridio.com/guides/avocado-cli/overview— 404, the/guides/prefix was retiredgetting-started/index.mdx/avocado-desktop/overview/developer-reference/getting-started/download/avocado-desktop/overviewavocado-desktop/overview.mdx×2peridio.com/avocado-os#downloads, the pre-/downloadsanchorNothing on the docs site linked to
peridio.com/downloadsanywhere —grepreturned zero hits.What changed
HostPrerequisitesis the single component all four getting-started surfaces render (Jetson, QEMU, Raspberry Pi, and the Any-Supported-Target selector), so that is where the fix lands rather than in four call sites: both CLI links now resolve to the installation page, "install Avocado Desktop" resolves to the download, and the artifact list is named alongside them.sync-references.js, not in the files. They are gitignored build output generated fromavocado-linux/references, so editing them does not persist, and we have read-only access upstream. The rewrite sits next to the existing relative-link pass — same class of problem, same seam — so it survives every resync and lapses on its own if upstream is corrected./getting-started/downloadnow redirects to the CLI installation page./downloads#desktop.Left alone deliberately: the tool-choice links in
provisioning.mdandmcp/installation.mdpoint at overview pages to say what a tool is, which is the right destination for those sentences — and both overviews now route onward to acquisition.Verification
npm run buildpasses, including Docusaurus strict broken-link checking.installation; none remain onoverview. Theavocado-cli/overviewhits that remain in the build aremenu__linksidebar nav, which is correct./downloads—any-targetvia the selector, on target selection.npm run lint,npm run typecheck,npm run formatclean.npm run sync-references: 28 ×repointed 1 CLI link(s) → installation.The
peridio.com/downloadslinks 404 until peridio/apex#120 ships that page. This PR must land after it.Note on red CI
checks.ymland the CodeQLAnalyzejobs fail in 3–5 seconds with zero steps executed, which is a job that never started rather than a check that ran. This is pre-existing and repo-wide: every PR-triggeredChecksrun inperidio/docshas failed since 2026-08-17 13:43 UTC, including on the unrelateddeveloper-reference/device-tree-overlaysbranch; the last PR-branch success was 2026-08-15. GitHub status is operational, so it looks like an org-level Actions/permissions/quota change. Not caused by this diff — the equivalent checks all pass locally. Worth a separate issue.