Content workflow
Use bun run content:refresh to rebuild the homepage and run smoke tests in one pass. Add CONTENT_WRANGLER_DEV=1 to automatically launch bunx wrangler dev after the checks complete; Astro will emit the sitemap during full builds.
Generated HTML and sitemap.xml remain ignored by git; commit only the source templates, partials, and the site config.
Developer workflow
flowchart TD
Start([Edit Content]) --> Type{What changed?}
Type -->|Templates/Partials| Build1["bun run build:home"]
Type -->|Site Copy| Build1
Type -->|Both| Build1
Build1 --> Test{Need to verify?}
Test -->|Quick Check| Preview["bun run dev<br/>(Wrangler preview)"]
Test -->|Full Validation| Tests["bun test<br/>(Run test suite)"]
Test -->|Just Content| Commit
Preview --> Satisfied{Looks good?}
Satisfied -->|No| Start
Satisfied -->|Yes| Commit
Tests --> Pass{Tests pass?}
Pass -->|No| Start
Pass -->|Yes| Commit
Commit([Commit Changes])
Dev[/"Active editing?<br/>Use bun run dev"/]
Dev -.->|Hot reload| Build1
Refresh[/"One command for all?<br/>bun run content:refresh"/]
Refresh -.->|Build + Sitemap + Tests| Tests
style Start fill:#e8f5e9
style Commit fill:#e8f5e9
style Build1 fill:#e3f2fd
style Sitemap fill:#e3f2fd
style Preview fill:#fff3e0
style Tests fill:#fff3e0
style Dev fill:#f3e5f5
style Refresh fill:#f3e5f5
Core steps
- Edit source files in
app/src/content/pages/en/(for example,app/src/content/pages/en/studio/about/index.mdorapp/src/content/pages/en/tools/). Update shared site copy inapp/src/content/site.json. - Refresh content and run smoke tests with
bun run content:refreshto keep feeds, navigation, and lastmod values current while surfacing errors early in CI and local workflows. - Preview in Wrangler by setting
CONTENT_WRANGLER_DEV=1when you need to verify asset serving, redirects, and API endpoints in the Worker.
Hiding drafts or sensitive pages from search
Set a robots directive in frontmatter when a page should be excluded from indexing or link following:
---
title: Draft Page
meta:
robots: noindex, nofollow
---
Keep the directive on draft or internal-only pages until they are ready for publication.
Examples
Update the About page
- Edit
app/src/content/pages/en/studio/about/index.md(andapp/src/content/pages/en/studio/about/studio/index.mdif needed). - Run
bun run build:hometo refreshindex.htmland generated outputs. - Run
bun testbefore committing.
Update site copy
- Keep shared copy in
app/src/content/site.jsoncurrent. - When new strings power content templates, ensure placeholders and tone align with the surrounding voice.
- Rebuild and verify navigation labels render correctly in the preview.
Fragment IDs and deep links
- Namespace IDs: Prefix section and form IDs with the page slug or feature (
home-newsletter-email,about-contact-form) to avoid collisions across partials. - Preserve published anchors: Fragments used in navigation or marketing (
#contact,#studio) should be treated as permalinks. If you must rename an anchor, add an alias or redirect so existing links remain valid. - Match ARIA hooks: Update
for,aria-labelledby,aria-controls, anddata-*hooks whenever an ID changes to keep assistive technology mappings intact. - Use data attributes for scripts: Reach for
data-*attributes when a hook is only needed for JavaScript and not for deep linking. This keeps anchor space clear for user-facing fragments.
Tips
- Use
bun run devduring active editing to preview updates toapp/src/content/pages/with hot reload. - Set
SKIP_BUILD_HOME=1before re-running tests if the site is already built and you only need to validate logic changes. - Keep accessibility in mind: confirm skip links, focus order, and contrast remain sound after content or layout adjustments.