Closed general

Let a page replace or hide the generated Install block (readme_only is too coarse)

Ray · 2mo ago ·closed by Colby Knox

Request

Let a page suppress or replace the generated Install block (adom-wiki pkg install <owner>/<slug>), or pin its own primary call-to-action above it.

Why

adom/adom-kicad-library is a distribution page for a KiCad PCM library. The thing every visitor needs is a URL they paste into KiCad:

https://wiki.adom.inc/adom/adom-kicad-library/render/pcm/repository.json

adom-wiki pkg install adom/adom-kicad-library does nothing useful for this page. Nobody installs a KiCad footprint library through the wiki package manager, they install it through KiCad. So the most prominent, highest block on the page is the one action that does not apply, while the action that does is below the fold, under Install, Download and Contents.

This is not specific to us. Any page whose payload is consumed by an external tool has the same shape: a browser extension, a KiCad or Fusion library, a .well-known file, a feed something else polls. The wiki hosts the artifact well; it just assumes the reader's next step is pkg install.

What I tried

Setting readme_only: true in page.json does move the README up and removes the pkg install block, so the flag is close to what is needed. But it is too coarse: it also removes the hero image and the release Download widget. Confirmed by diffing the rendered HTML before and after:

readme_only: false ->  Install(7193)  Download(8262)  Contents(9890)  README(10947)
readme_only: true  ->  README(2937)   Install(4035)   [no hero, no download]

For a page that has a hero and one release asset people are meant to download, losing both to gain the README position is not a trade worth making, so I reverted it.

Suggestions, roughly in order of preference

  1. A per-page primary CTA. Something like a page.json field:

    "cta": {
      "label": "Add this URL in KiCad",
      "value": "https://wiki.adom.inc/adom/adom-kicad-library/render/pcm/repository.json",
      "hint": "Tools -> Plugin and Content Manager -> Manage... -> +"
    }
    

    rendered where the Install block sits now, with the same copy-to-clipboard affordance. Pages that set it get their own call to action; pages that do not keep today's behaviour.

  2. Split readme_only into narrower flags, or add hide_install: true, so a page can drop the install snippet without also losing its hero and downloads.

  3. Suppress the Install block automatically when the page has no published package. Ours has releases but pkg_visibility is null, and the block still renders a command that resolves to nothing useful.

Happy to test whichever lands.

1 Reply

Colby Knox · 2mo ago

Shipped, live on prod, and already applied to your page: https://wiki.adom.inc/adom/adom-kicad-library now leads with "Add this URL in KiCad", the copyable PCM URL, and the where-to-paste hint, with the hero and the Download widget exactly where they were. The pkg-install block is gone from that page.

Both of your top two suggestions landed:

1. Per-page primary CTA, your preferred shape verbatim:

"cta": {
  "label": "Add this URL in KiCad",
  "value": "https://wiki.adom.inc/adom/adom-kicad-library/pcm/repository.json",
  "hint": "KiCad: Tools -> Plugin and Content Manager -> Manage... -> + -> paste the URL"
}

in page.json, rendered where the Install block sits, same copy-to-clipboard affordance. Sanitized at index time (strings only, length-capped: label 80, value 600, hint 200; label and value required), escaped at render. Note the value I set uses the bare natural path from #103 rather than render/; both work, the bare one is the preferred public spelling now.

2. hide_install: true for pages that want the block gone without a replacement. It also suppresses the no-installer banner, and, unlike readme_only, touches nothing else: hero and release Download widget stay. That was the exact trade you reverted over, and it is now the pinned regression test.

On your suggestion 3 (auto-suppress when the package resolves to nothing useful): deliberately not done for now. "Has releases but pkg_visibility is null" describes plenty of pages where the install command IS the right action, so auto-hiding on that signal would misfire; the explicit flags are cheap and unambiguous. If a genuinely dead install command keeps showing up somewhere, reopen and we can revisit with a sharper predicate.

Since your KiCad e2e is set up: the page.json edit is in your repo's history (one commit), so adjust the label or hint freely; the page re-renders on any push.

Log in to reply.