# Getting started

> Install sitelo and build your first static site.

sitelo is a zero-config static site generator powered by Vite. Install one package, write functions that return HTML, and run `sitelo build`.

## Install

`shell`

```bash
npm install -D sitelo
```

Requires Node 20.19+ (or 22.12+). Vite is bundled — you do not install it separately.

## Your first page

Create `src/index.ht.js` (or `.ht.jsx`). [ht.js](https://ht.js.org) is recommended:

`src/index.ht.js — Template literal`

```javascript
export default () => `
  <html lang="en">
    <head><title>My website</title></head>
    <body><h1>Hello world</h1></body>
  </html>
`
```

`src/index.ht.js — ht.js (recommended)`

```javascript
import { html, head, title, body, h1 } from 'javascript-to-html'

export default () =>
  html({ lang: 'en' },
    head(title('My website')),
    body(h1('Hello world'))
  )
```

`src/index.ht.jsx — JSX`

```jsx
export default function Home() {
  return (
    <html lang="en">
      <head><title>My website</title></head>
      <body><h1>Hello world</h1></body>
    </html>
  )
}
```

## Run

`shell`

```bash
sitelo          # dev server
sitelo build    # write dist/
sitelo preview  # preview the build
```

That emits `dist/index.html` (with `<!DOCTYPE html>` added for you) plus a default `404.html`.

## Next

- [Writing pages](https://sitelo.dev/docs/pages) — template strings, JSX, structured modules
- [Routing](https://sitelo.dev/docs/routing) — file-based routes and `generateStaticParams`
- [Data loading](https://sitelo.dev/docs/data) — `data()` and `fetchWithCache`
- [Assets & styling](https://sitelo.dev/docs/assets) — frontend JS/CSS compiled by Vite (`src/js`, `src/css`)
- [Configuration](https://sitelo.dev/docs/configuration) — `sitelo.config.js` and Vite options
- [Build with AI](https://sitelo.dev/docs/build-with-ai) — `llms.txt`, project rules, and agent tips
