Skip to content

Add tracked Download buttons to resource pages and the landing detail view - #573

Merged
Alejandro Lopez (soyalejolopez) merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-download-buttons
Oct 29, 2026
Merged

Alejandro Lopez (soyalejolopez) merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-download-buttons

Conversation

@soyalejolopez

Copy link
Copy Markdown
Member

Category

  • New resource (script, agent, guide, analytics, skill)
  • Update to an existing resource
  • Bug fix
  • Docs, site, or tooling

What's in this pull request?

Adds a Download button to resource pages (r/<slug>/) and the landing-page detail view, and records each click in Clarity as a resource_download event, the same way resource_preview is recorded. That gives us a download count per resource without adding any tracking to the downloaded files.

Which resources get a button (24 of 58)

The catalog picks the file from the resource folder, so nothing needs hand-curating:

Format File offered
interactive index.html, saved as <slug>.html. All five interactive pages are single self-contained files with no sibling dependencies (checked).
pptx, pbix The only .pptx or .pbix in the folder.
ps1 The only .ps1, and only when the folder has no module, data, or template files next to it, so a script that needs .psm1, .json, .csv and similar is never offered alone.
bundle, declarative, md No button.

Archived resources never get one. An optional download front matter field names the file explicitly (relative path, validated, must exist); the Technical Advisory uses it for its PDF. The button shows the file size.

What changed

  • tools/catalog-build/downloads.js (new): the selection rules, file naming and size formatting.
  • tools/catalog-build/index.js: validates download; catalog.json gets download, downloadName and downloadSize for eligible resources.
  • tools/catalog-build/site-pages.js, assets/resource-page.css, index.html: the button on resource pages and the landing detail view. Resource pages reuse the existing data-event click handler; the landing page fires the event itself. Pages without a download are byte-for-byte unchanged, so only the 24 pages that gain a button are in this diff.
  • tools/catalog-build/test-downloads.js (new, in npm run check): selection and naming rules. test-site-output.js now also checks the rendered link, the Clarity attribute, the size label, and that archived, bundle, declarative and Markdown resources have none.
  • docs/CATALOG-METADATA.md, CHANGELOG.md: document the field and the button.
  • Technical Advisory: download: Agent-365-Technical-Advisory.pdf, version 1.0.1.

Where counts appear: the Clarity dashboard (custom event resource_download). Clarity's export API does not expose custom events, so the counts are not in resource-stats.json or on the cards.

Verified in a browser (local server): the button shows with the right file name and size on a resource page and on the landing detail view; clicking fires resource_download; it is hidden for an archived resource and a bundle; the PDF link returns application/pdf.

Related issues

Follows #572.

Checklist

  • No private, customer-specific, or unlicensed content, and no secrets
  • README front matter is valid: npm ci --prefix tools/catalog-build && npm run check --prefix tools/catalog-build (passes)
  • version and updated were bumped (and published was preserved): Technical Advisory only, because its README changed
  • Installation and usage steps were tested
  • Files over 5 MB were avoided
  • If this changes the Agent 365 Customer Implementation Guide or Enablement Checklist: not applicable, neither changed

See CONTRIBUTING.md for details.

… view

Resources that are one self-contained file (interactive guides, single-file scripts, PPTX, PBIX, the Technical Advisory PDF) now offer a Download button that records a Clarity resource_download event. The file is derived from the resource folder or set with the optional download front matter field. Archived resources, bundles, declarative agents, and Markdown resources never get one.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@soyalejolopez
Alejandro Lopez (soyalejolopez) merged commit b892896 into microsoft:master Oct 29, 2026
5 checks passed
@soyalejolopez
Alejandro Lopez (soyalejolopez) deleted the soyalejolopez-download-buttons branch October 29, 2026 16:34
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