summaryrefslogtreecommitdiff
path: root/.changeset/tricky-rabbits-count.md
blob: a9d015b08ea6c7f65e3b5d43e75eb2528d42daaf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
'astro': major
---

Remove deprecated `Astro` global APIs, including `Astro.resolve`, `Astro.fetchContent`, and `Astro.canonicalURL`.

#### `Astro.resolve`

You can resolve asset paths using `import` instead. For example:

```astro
---
import 'style.css'
import imageUrl from './image.png'
---

<img src={imageUrl} />
```

See the [v0.25 migration guide](https://docs.astro.build/en/migrate/#deprecated-astroresolve) for more information.

#### `Astro.fetchContent`

Use `Astro.glob` instead to fetch markdown files, or migrate to the [Content Collections](https://docs.astro.build/en/guides/content-collections/) feature.

```js
let allPosts = await Astro.glob('./posts/*.md');
```

#### `Astro.canonicalURL`

Use `Astro.url` instead to construct the canonical URL.

```js
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
```