mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
5eba34fcc6
* Remove deprecated Astro globals * Remove deprecated hook param * Fix test * Add changeset * Add TODO
844 B
844 B
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:
---
import 'style.css'
import imageUrl from './image.png'
---
<img src={imageUrl} />
See the v0.25 migration guide for more information.
Astro.fetchContent
Use Astro.glob
instead to fetch markdown files, or migrate to the Content Collections feature.
let allPosts = await Astro.glob('./posts/*.md');
Astro.canonicalURL
Use Astro.url
instead to construct the canonical URL.
const canonicalURL = new URL(Astro.url.pathname, Astro.site);