HCTHE HCLAB

Resources & downloads

Resources are downloadable files listed on /resources. Downloads go through /api/dl/[id], which enforces access rules before redirecting to the file URL.

Admin path

/admin/resources → New resource → /admin/resources/new

Fields

Field Purpose
Title Display name
Slug URL key (listing only — downloads use ID)
Description Card text and default teaser
Visibility / Teaser See Access & gating
File URL Direct link to the asset (HTTPS) — required
Thumbnail URL Optional preview image
Type Template, Framework, Assessment, Guide, Playbook, Prompt pack, Report
Category Pillar category (optional)
Tags Comma-separated labels
Published Live on public site

Resource types

Type Typical use
TEMPLATE Fill-in templates
FRAMEWORK Framework PDFs or worksheets
ASSESSMENT Assessment worksheets
GUIDE How-to guides
PLAYBOOK Process playbooks
PROMPT_PACK AI prompt collections
REPORT Reports and whitepapers

File hosting

The CMS stores a URL, not the file itself. Upload assets to your storage provider (e.g. Cloudflare R2, S3) and paste the public HTTPS URL into File URL.

Requirements:

  • URL must be reachable over HTTPS
  • Use stable URLs — changing the file URL requires a CMS edit
  • For gated resources, the file URL should not be guessable if security matters (access is still enforced at /api/dl/[id])

Download flow

  1. User clicks Download on /resources
  2. Browser hits /api/dl/[resource-id]
  3. Server checks published status and visibility
  4. If allowed → redirect to fileUrl and increment download count
  5. If blocked → redirect to signup, login, or /pricing

Download counts appear in admin analytics.

Step-by-step: publish a resource

  1. Upload file to storage; copy the public URL
  2. /admin/resources/new
  3. Title, description, file URL, type
  4. Assign Category for pillar filtering on /resources
  5. Set Visibility (Public / Free member / Premium)
  6. Check Published
  7. Save → find the resource on /resources → test download in a private window

Learning path items

Resources can be included in learning paths. Use content type RESOURCE and paste the resource ID from /admin/resources/[id].

Common mistakes

  • Missing or broken File URL — download redirects to a 404
  • Forgetting Published — resource hidden from listing
  • Premium resource without Stripe configured — users hit pricing gate with no upgrade path
  • Using slug in download links — downloads always use the database ID via /api/dl/[id]