Skip to content
UNSW Centre for Sustainable Development Reform Research Platform

Platform Technical Guide

Technical reference for working in the CSDR Research Centre monorepo. Covers repository workflow, content structure, build commands, and asset management.

Repository Workflow

All changes go through branches and pull requests — never push directly to main.

Branch Naming

{type}/{project}/{description}

Types: update feature fix access archive infra

Examples:

  • feature/climate-risk/add-q2-assessment
  • fix/platform/sidebar-ordering
  • update/finance-dashboard/revenue-figures

Commits

Use the format: "type: description"

update: add Q2 climate risk data
fix: correct sidebar ordering for archive projects

Submitting Changes

  1. Commit your changes
  2. Push the branch
  3. Create a pull request: gh pr create --base main

Binary Files

Files larger than 200 KB or binary formats (images, PDFs, spreadsheets, videos) must not be committed to git. Upload them to the asset library instead:

Terminal window
npm run upload -- <file> <project>

They are then available at: https://assets.csdr.global/assets/{project}/{category}/{filename}

Categories: figures data outputs media misc

Exception: Small assets under 50 KB in the public/ directory (favicons, logos).

Content Structure

File Paths

All content lives under src/content/docs/{project}/. Each project has its own directory with an index.md entry point.

Frontmatter Fields

Every page requires frontmatter at the top of the file:

---
title: Page Title
project: climate-risk
visibility: internal
content_type: report
sidebar_category: projects
---
FieldDescription
titlePage title (displayed in sidebar and heading)
projectProject identifier (matches directory name)
visibilityAccess tier: public, internal, client, restricted
content_typeType of content: report, reference, dashboard, presentation, archive
sidebar_categorySidebar grouping: projects, operations, archive

Visibility Tiers

TierWhere it appears
publicInternal site + public site
internalInternal site only
clientInternal site + isolated spoke (email-gated)
restrictedSidebar link only; content in separate spoke (MFA-gated)

Presentations

Slide decks use *** (three asterisks) as the slide delimiter. The first slide becomes a title slide automatically.

Build & Deploy Commands

CommandDescription
npm run devStart local dev server
npm run build:internalBuild internal site
npm run build:publicBuild public site
npm run build:allBuild internal + PDF + DOCX
npm run build:pdfGenerate PDFs only
npm run build:docxGenerate Word documents only
npm run upload -- <file> <project>Upload asset to R2

The sidebar is auto-generated from project index.md frontmatter. To regenerate after adding or modifying projects:

Terminal window
node _infrastructure/scripts/generate-sidebar.mjs

This outputs _build/sidebar-internal.mjs and _build/sidebar-public.mjs. Do not edit these files manually.

  • projects — All substantive work: research, client assessments, partnerships, advisory (not collapsed)
  • operations — Centre administration, dashboards, internal tools (collapsed)
  • archive — Completed and historical projects (collapsed)

Asset Management

Assets are stored in Cloudflare R2 and served from https://assets.csdr.global/.

URL Pattern

assets/{project}/{category}/{filename}

Markdown Placeholders

Use these placeholders in markdown content — they are expanded at build time:

  • https://assets.csdr.global — resolves to the assets base URL
  • https://subdomain.csdr.global — resolves to a spoke site URL

Domain Configuration

All domain URLs are centralised in config/site.mjs. Override via environment variables:

VariableDefault
BASE_DOMAINcsdr.global
SITE_PROTOCOLhttps
INTERNAL_SUBDOMAINinternal
PUBLIC_SUBDOMAINdocs
ASSETS_SUBDOMAINassets