# Upgrading

> How to upgrade JAAB, and the changes that need action, by the version you upgrade from.

JAAB is released with JAAD and the other JAAMD packages, on one version. Upgrade
it, and JAAD beside it on a site with both:

**npm**

```bash
npm install @jaamd/jaab@latest
```

**pnpm**

```bash
pnpm add @jaamd/jaab@latest
```

**yarn**

```bash
yarn add @jaamd/jaab@latest
```

**bun**

```bash
bun add @jaamd/jaab@latest
```

Then run a build and read below the changes since the version you upgrade from.

## From 1.2

### Language directories

Directories named after languages under `blog/` now make one blog per
[language](https://docs.jaamd.org/jaab/guides/languages.md). A blog in one language is affected only
when its posts sit in such directories: two of them, as `it/` and `id/`, or one
that [`lang`](https://docs.jaamd.org/jaad/configuration/lang.md) names, as `en/` on an
English blog. Its posts then move to each language's addresses, or the build
stops with `jaab: mixed blog tree`.

Keep them directories of posts with
[`locales`](https://docs.jaamd.org/jaab/configuration/locales.md):

```ts
locales: false,
```

### A layout of your own

A [layout](https://docs.jaamd.org/jaab/guides/layout.md) gets the page's `locale` and its
`alternates` in each language, for a switcher; `getPosts()` takes a language,
`getPosts('it')`. A blog without language directories has the site's `lang`
and no alternates, so a layout written for 1.2 needs no change.
