Local setup
Contributors
git clone https://github.com/Tophhie/tophhiecloud-docs.gitcd tophhiecloud-docs && npm install && npx astro dev --backgroundThat serves the site at localhost:4321 and reloads as you write.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
npx astro dev --background |
Dev server, in the background |
npm run dev |
Dev server in the foreground |
npm run build |
Build to dist/, and the closest thing this repo has to a test suite |
npm run preview |
Build, then serve the built output |
npm run deploy |
Build and deploy to Cloudflare |
Build is the test suite
Section titled “Build is the test suite”npm run build fails on broken content: bad frontmatter, a sidebar entry pointing at a
directory that does not exist, a missing image, a link to a page that is not there.
Run it before opening a pull request. It is faster than waiting for a review to tell you the same thing.
Two things that only work in a build
Section titled “Two things that only work in a build”Search. Pagefind indexes the built HTML, so the search box does nothing in astro dev.
Use npm run preview to try it.
Images. Images are optimised at build time, so an image can appear broken in the dev
server and be perfectly correct in the built site. Check with npm run preview before
concluding anything is wrong.
Checks before a pull request
Section titled “Checks before a pull request”npm run buildpasses.- The pages you touched look right in
npm run preview. - New pages appear in the sidebar where you expected.
- Internal links go where they should.

