Releases: withastro/astro
astro@5.2.5
Patch Changes
-
#13133
e76aa83
Thanks @ematipico! - Fixes a bug where Astro was failing to build an external redirect when the middleware was triggered -
#13119
ac43580
Thanks @Hacksore! - Adds extra guidance in the terminal when using theastro add tailwind
CLI commandNow, users are given a friendly reminder to import the stylesheet containing their Tailwind classes into any pages where they want to use Tailwind. Commonly, this is a shared layout component so that Tailwind styling can be used on multiple pages.
astro@5.2.4
@astrojs/preact@4.0.4
@astrojs/markdoc@0.12.9
Patch Changes
- Updated dependencies [
b71bd10
]:- @astrojs/internal-helpers@0.5.1
@astrojs/internal-helpers@0.5.1
astro@5.2.3
Patch Changes
-
#13113
3a26e45
Thanks @unprintable123! - Fixes the bug that rewrite will pass encoded url to the dynamic routing and cause params mismatch. -
#13111
23978dd
Thanks @ascorbic! - Fixes a bug that caused injected endpoint routes to return not found when trailingSlash was set to always -
#13112
0fa5c82
Thanks @ematipico! - Fixes a bug where the i18n middleware was blocking a server island request when theprefixDefaultLocale
option is set totrue
astro@5.2.2
astro@5.2.1
astro@5.2.0
Minor Changes
-
#12994
5361755
Thanks @ascorbic! - Redirects trailing slashes for on-demand pagesWhen the
trailingSlash
option is set toalways
ornever
, on-demand rendered pages will now redirect to the correct URL when the trailing slash doesn't match the configuration option. This was previously the case for static pages, but now works for on-demand pages as well.Now, it doesn't matter whether your visitor navigates to
/about/
,/about
, or even/about///
. In production, they'll always end up on the correct page. For GET requests, the redirect will be a 301 (permanent) redirect, and for all other request methods, it will be a 308 (permanent, and preserve the request method) redirect.In development, you'll see a helpful 404 page to alert you of a trailing slash mismatch so you can troubleshoot routes.
-
#12979
e621712
Thanks @ematipico! - Adds support for redirecting to external sites with theredirects
configuration option.Now, you can redirect routes either internally to another path or externally by providing a URL beginning with
http
orhttps
:// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ redirects: { '/blog': 'https://example.com/blog', '/news': { status: 302, destination: 'https://example.com/news', }, }, });
-
#13084
0f3be31
Thanks @ematipico! - Adds a new experimental virtual moduleastro:config
that exposes a type-safe subset of yourastro.config.mjs
configurationThe virtual module exposes two sub-paths for controlled access to your configuration:
astro:config/client
: exposes config information that is safe to expose to the client.astro:config/server
: exposes additional information that is safe to expose to the server, such as file/dir paths.
To enable this new virtual module, add the
experimental.serializeManifest
feature flag to your Astro config:// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { serializeManifest: true, }, });
Then, you can access the module in any file inside your project to import and use values from your Astro config:
// src/utils.js import { trailingSlash } from 'astro:config/client'; function addForwardSlash(path) { if (trailingSlash === 'always') { return path.endsWith('/') ? path : path + '/'; } else { return path; } }
For a complete overview, and to give feedback on this experimental API, see the Serialized Manifest RFC.
Patch Changes
-
#13049
2ed4bd9
Thanks @florian-lefebvre! - Updatesastro add tailwind
to add the@tailwindcss/vite
plugin instead of the@astrojs/tailwind
integration -
#12994
5361755
Thanks @ascorbic! - Returns a more helpful 404 page in dev if there is a trailing slash mismatch between the route requested and thetrailingSlash
configuration -
#12666
037495d
Thanks @Thodor12! - Added additional generated typings for the content layer -
Updated dependencies [
5361755
,db252e0
]:- @astrojs/internal-helpers@0.5.0
- @astrojs/markdown-remark@6.1.0
@astrojs/tailwind@6.0.0
Major Changes
-
#13049
2ed4bd9
Thanks @florian-lefebvre! - Deprecates the integrationTailwind CSS now offers a Vite plugin which is the preferred way to use Tailwind 4 in Astro. Please uninstall
@astrojs/tailwind
and follow the Tailwind documentation for manual installation.This updated major version is only provided as a convenience for existing projects until they are able to migrate to the new plugin. It offers no additional functionality and is no longer recommended, but may continue to be used in your projects until it is removed entirely.