Ir al contenido
verdict:

Astro 6.0.0-beta.6

preview

note: la síntesis y las notas de la versión están en inglés

note: sin síntesis para esta release más antigua

Sintetizamos las releases recientes. Las notas de la versión originales de esta versión están aquí abajo.

release-notesgithub.com/withastro/astro · 115 líneas
  1. ### Major Changes
  2. - [#15332](https://github.com/withastro/astro/pull/15332) [`7c55f80`](https://github.com/withastro/astro/commit/7c55f80fa1fd91f8f71ad60437f81e6c7f98f69d) Thanks [@matthewp](https://github.com/matthewp)! - Adds frontmatter parsing support to `renderMarkdown` in content loaders. When markdown content includes frontmatter, it is now extracted and available in `metadata.frontmatter`, and excluded from the HTML output. This makes `renderMarkdown` behave consistently with the `glob` loader.
  3. ```js
  4. const loader = {
  5. name: 'my-loader',
  6. load: async ({ store, renderMarkdown }) => {
  7. const content = `---
  8. title: My Post
  9. ---
  10. # Hello World
  11. `;
  12. const rendered = await renderMarkdown(content);
  13. // rendered.metadata.frontmatter is now { title: 'My Post' }
  14. // rendered.html contains only the content, not the frontmatter
  15. },
  16. };
  17. ```
  18. ### Minor Changes
  19. - [#15291](https://github.com/withastro/astro/pull/15291) [`89b6cdd`](https://github.com/withastro/astro/commit/89b6cdd4075f5c9362291c386bb1e7c100b467a5) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the `experimental.fonts` flag and replaces it with a new configuration option `fonts` - ([v6 upgrade guidance](https://v6.docs.astro.build/en/guides/upgrade-to/v6/#experimental-flags))
  20. - [#15332](https://github.com/withastro/astro/pull/15332) [`7c55f80`](https://github.com/withastro/astro/commit/7c55f80fa1fd91f8f71ad60437f81e6c7f98f69d) Thanks [@matthewp](https://github.com/matthewp)! - Adds a `fileURL` option to `renderMarkdown` in content loaders, enabling resolution of relative image paths. When provided, relative image paths in markdown will be resolved relative to the specified file URL and included in `metadata.localImagePaths`.
  21. ```js
  22. const loader = {
  23. name: 'my-loader',
  24. load: async ({ store, renderMarkdown }) => {
  25. const content = `
  26. # My Post
  27. ![Local image](./image.png)
  28. `;
  29. // Provide a fileURL to resolve relative image paths
  30. const fileURL = new URL('./posts/my-post.md', import.meta.url);
  31. const rendered = await renderMarkdown(content, { fileURL });
  32. // rendered.metadata.localImagePaths now contains the resolved image path
  33. },
  34. };
  35. ```
  36. - [#15291](https://github.com/withastro/astro/pull/15291) [`89b6cdd`](https://github.com/withastro/astro/commit/89b6cdd4075f5c9362291c386bb1e7c100b467a5) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new Fonts API to provide first-party support for adding custom fonts in Astro.
  37. This feature allows you to use fonts from both your file system and several built-in supported providers (e.g. Google, Fontsource, Bunny) through a unified API. Keep your site performant thanks to sensible defaults and automatic optimizations including preloading and fallback font generation.
  38. To enable this feature, configure `fonts` with one or more fonts:
  39. ```js title="astro.config.mjs"
  40. import { defineConfig, fontProviders } from 'astro/config';
  41. export default defineConfig({
  42. fonts: [
  43. {
  44. provider: fontProviders.fontsource(),
  45. name: 'Roboto',
  46. cssVariable: '--font-roboto',
  47. },
  48. ],
  49. });
  50. ```
  51. Import and include the `<Font />` component with the required `cssVariable` property in the head of your page, usually in a dedicated `Head.astro` component or in a layout component directly:
  52. ```astro
  53. ---
  54. // src/layouts/Layout.astro
  55. import { Font } from 'astro:assets';
  56. ---
  57. <html>
  58. <head>
  59. <Font cssVariable="--font-roboto" preload />
  60. </head>
  61. <body>
  62. <slot />
  63. </body>
  64. </html>
  65. ```
  66. In any page rendered with that layout, including the layout component itself, you can now define styles with your font's `cssVariable` to apply your custom font.
  67. In the following example, the `<h1>` heading will have the custom font applied, while the paragraph `<p>` will not.
  68. ```astro
  69. ---
  70. // src/pages/example.astro
  71. import Layout from '../layouts/Layout.astro';
  72. ---
  73. <Layout>
  74. <h1>In a galaxy far, far away...</h1>
  75. <p>Custom fonts make my headings much cooler!</p>
  76. <style>
  77. h1 {
  78. font-family: var('--font-roboto');
  79. }
  80. </style>
  81. </Layout>
  82. ```
  83. Visit the updated [fonts guide](https://v6.docs.astro.build/en/guides/fonts/) to learn more about adding custom fonts to your project.
  84. ### Patch Changes
  85. - [#15337](https://github.com/withastro/astro/pull/15337) [`7ff7b11`](https://github.com/withastro/astro/commit/7ff7b1160d2d60e40073ddc422fc7a00c59696aa) Thanks [@ematipico](https://github.com/ematipico)! - Fixes a bug where the development server couldn't serve newly created new pages while the development server is running.
  86. - [#15331](https://github.com/withastro/astro/pull/15331) [`4592be5`](https://github.com/withastro/astro/commit/4592be5bb7490474fe5e204f60b7131d9a79dae5) Thanks [@matthewp](https://github.com/matthewp)! - Fixes an issue where API routes would overwrite public files during build. Public files now correctly take priority over generated routes in both dev and build modes.
  87. - Updated dependencies \[[`7c55f80`](https://github.com/withastro/astro/commit/7c55f80fa1fd91f8f71ad60437f81e6c7f98f69d)]:
  88. - @astrojs/markdown-remark@7.0.0-beta.3

ver en githubimported 2026-09-28 vía npm