Skip to content

Releases: withastro/astro

[email protected]

23 Jul 17:15
9362743
Compare
Choose a tag to compare

Minor Changes

  • #14115 270e009 Thanks @ascorbic! - Removes "Open in x" badges from the README of the official Astro templates when a new project is created

  • #14115 270e009 Thanks @ascorbic! - Adds support for marking sections in template READMEs to be removed when the create astro command is used to create a new project

    Theme authors can now use magic comments in template READMEs to mark sections that should not be included when a user runs create-astro with the --template flag to create a new project.

    This allows templates to have content that is visible when viewed in the source repo but not when the template is copied for use in a new project. This is useful for content that is appropriate for a theme's own repository, but will not be useful to someone using the theme, such as
    an "Open this repository in StackBlitz" badge where the URL is hardcoded .

    Use the magic comments <!-- ASTRO:REMOVE:START --> and <!-- ASTRO:REMOVE:END --> to indicate content to be excluded from your README during the create astro process.

    <!-- ASTRO:REMOVE:START -->
    
    [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
    
    <!-- ASTRO:REMOVE:END -->

    Note that these comments only remove content when new projects are created using create astro. When your theme template is forked, your README will be copied in its entirety.

[email protected]

23 Jul 17:15
9362743
Compare
Choose a tag to compare

Patch Changes

  • #14119 14807a4 Thanks @ascorbic! - Fixes a bug that caused builds to fail if a client directive was mistakenly added to an Astro component

  • #14001 4b03d9c Thanks @dnek! - Fixes an issue where getImage() assigned the resized base URL to the srcset URL of ImageTransform, which matched the width, height, and format of the original image.

@astrojs/[email protected]

23 Jul 17:15
9362743
Compare
Choose a tag to compare

Patch Changes

[email protected]

22 Jul 19:37
7b154d6
Compare
Choose a tag to compare

Patch Changes

[email protected]

21 Jul 14:56
d271698
Compare
Choose a tag to compare

Patch Changes

@astrojs/[email protected]

21 Jul 14:56
d271698
Compare
Choose a tag to compare

Patch Changes

@astrojs/[email protected]

21 Jul 14:56
d271698
Compare
Choose a tag to compare

Patch Changes

[email protected]

17 Jul 13:19
ca05a2f
Compare
Choose a tag to compare

Minor Changes

  • #13971 fe35ee2 Thanks @adamhl8! - Adds an experimental flag rawEnvValues to disable coercion of import.meta.env values (e.g. converting strings to other data types) that are populated from process.env

    Astro allows you to configure a type-safe schema for your environment variables, and converts variables imported via astro:env into the expected type.

    However, Astro also converts your environment variables used through import.meta.env in some cases, and this can prevent access to some values such as the strings "true" (which is converted to a boolean value), and "1" (which is converted to a number).

    The experimental.rawEnvValues flag disables coercion of import.meta.env values that are populated from process.env, allowing you to use the raw value.

    To enable this feature, add the experimental flag in your Astro config:

    import { defineConfig } from "astro/config"
    
    export default defineConfig({
    +  experimental: {
    +    rawEnvValues: true,
    +  }
    })

    If you were relying on this coercion, you may need to update your project code to apply it manually:

    - const enabled: boolean = import.meta.env.ENABLED
    + const enabled: boolean = import.meta.env.ENABLED === "true"

    See the experimental raw environment variables reference docs for more information.

  • #13941 6bd5f75 Thanks @aditsachde! - Adds support for TOML files to Astro's built-in glob() and file() content loaders.

    In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader.

    Astro 5.12 now directly supports loading data from TOML files in content collections in both the glob() and the file() loaders.

    If you had added your own TOML content parser for the file() loader, you can now remove it as this functionality is now included:

    // src/content.config.ts
    import { defineCollection } from "astro:content";
    import { file } from "astro/loaders";
    - import { parse as parseToml } from "toml";
    const dogs = defineCollection({
    -  loader: file("src/data/dogs.toml", { parser: (text) => parseToml(text) }),
    + loader: file("src/data/dogs.toml")
      schema: /* ... */
    })

    Note that TOML does not support top-level arrays. Instead, the file() loader considers each top-level table to be an independent entry. The table header is populated in the id field of the entry object.

    See Astro's content collections guide for more information on using the built-in content loaders.

Patch Changes

@astrojs/[email protected]

17 Jul 13:18
ca05a2f
Compare
Choose a tag to compare

Patch Changes

@astrojs/[email protected]

17 Jul 13:18
ca05a2f
Compare
Choose a tag to compare

Patch Changes

  • #13941 6bd5f75 Thanks @aditsachde! - Adds support for TOML files to Astro's built-in glob() and file() content loaders.

    In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader.

    Astro 5.12 now directly supports loading data from TOML files in content collections in both the glob() and the file() loaders.

    If you had added your own TOML content parser for the file() loader, you can now remove it as this functionality is now included:

    // src/content.config.ts
    import { defineCollection } from "astro:content";
    import { file } from "astro/loaders";
    - import { parse as parseToml } from "toml";
    const dogs = defineCollection({
    -  loader: file("src/data/dogs.toml", { parser: (text) => parseToml(text) }),
    + loader: file("src/data/dogs.toml")
      schema: /* ... */
    })

    Note that TOML does not support top-level arrays. Instead, the file() loader considers each top-level table to be an independent entry. The table header is populated in the id field of the entry object.

    See Astro's content collections guide for more information on using the built-in content loaders.