diff --git a/website/astro.config.ts b/website/astro.config.ts
index 0a47322e4b01..7bcdfdeb1b42 100644
--- a/website/astro.config.ts
+++ b/website/astro.config.ts
@@ -108,6 +108,10 @@ export default defineConfig({
compressHTML: true,
+ image: {
+ domains: ["avatars.githubusercontent.com"],
+ },
+
integrations: [
react(),
starlight({
diff --git a/website/public/img/blog/announcing-biome/biome-logo-slogan.png b/website/public/img/blog/announcing-biome/biome-logo-slogan.png
deleted file mode 100644
index 7be42507dbe4..000000000000
Binary files a/website/public/img/blog/announcing-biome/biome-logo-slogan.png and /dev/null differ
diff --git a/website/public/img/blog/announcing-biome/JsNation_2023.jpg b/website/src/assets/blog/announcing-biome/JsNation_2023.jpg
similarity index 100%
rename from website/public/img/blog/announcing-biome/JsNation_2023.jpg
rename to website/src/assets/blog/announcing-biome/JsNation_2023.jpg
diff --git a/website/public/img/blog/prettier-challenge.png b/website/src/assets/blog/prettier-challenge.png
similarity index 100%
rename from website/public/img/blog/prettier-challenge.png
rename to website/src/assets/blog/prettier-challenge.png
diff --git a/website/src/components/BlogPostInfo.astro b/website/src/components/BlogPostInfo.astro
index ecc79e63344c..efc812737967 100755
--- a/website/src/components/BlogPostInfo.astro
+++ b/website/src/components/BlogPostInfo.astro
@@ -1,6 +1,7 @@
---
import "@src/styles/blog/index.scss";
import { getEntry, type CollectionEntry } from "astro:content";
+import { Image } from "astro:assets";
export interface Props {
post: CollectionEntry<"blog">["data"];
@@ -26,7 +27,7 @@ const authors = await getAuthorsData(
{
authors.map(({ data: author }) => (
-
+
))
}
diff --git a/website/src/content/blog/annoucing-biome.mdx b/website/src/content/blog/annoucing-biome.mdx
index beee35ed75c2..34fe27582f7e 100644
--- a/website/src/content/blog/annoucing-biome.mdx
+++ b/website/src/content/blog/annoucing-biome.mdx
@@ -7,9 +7,9 @@ authors:
- core
pubDate: 2023-08-29
coverImage:
- src: blog/announcing-biome/biome-logo-slogan.png
+ src: ../../assets/social-logo.png
alt: The name of the project - "Biome", with the slogan underneath that says "Toolchain of the web"
-socialImage: blog/announcing-biome/biome-logo-slogan.png
+socialImage: ../../assets/social-logo.png
---
We are happy to announce Biome, _toolchain of the web_.
@@ -60,11 +60,7 @@ A few new [OSS contributors](#the-core-team) joined the cause and helped in cont
In June, I [gave a talk](https://portal.gitnation.org/contents/rome-a-modern-toolchain) about Rome at JsNation 2023.
-
+![Emanuele Stoppa on the stage of JsNation](../../assets/blog/announcing-biome/JsNation_2023.jpg)
So, the project is still alive, but maintaining it has become challenging:
diff --git a/website/src/content/blog/biome-v1.mdx b/website/src/content/blog/biome-v1.mdx
index 42a09bbc5e0d..edd0ac598b53 100644
--- a/website/src/content/blog/biome-v1.mdx
+++ b/website/src/content/blog/biome-v1.mdx
@@ -6,7 +6,7 @@ authors:
- ema
- core
pubDate: 2023-08-29
-socialImage: social-logo.png
+socialImage: ../../assets/social-logo.png
---
In Biome v1, the formatter has options for JSX quotes and parentheses in the arrow functions; the CLI adds a new command `biome lint`, `.jsonc` files are supported, and it's possible to extend the configuration file.
diff --git a/website/src/content/blog/biome-wins-prettier-challenge.md b/website/src/content/blog/biome-wins-prettier-challenge.md
index cc753dc62179..f9412e8c9c53 100644
--- a/website/src/content/blog/biome-wins-prettier-challenge.md
+++ b/website/src/content/blog/biome-wins-prettier-challenge.md
@@ -7,9 +7,9 @@ authors:
- team
pubDate: 2023-11-27
coverImage:
- src: blog/prettier-challenge.png
+ src: ../../assets/blog/prettier-challenge.png
alt: The Prettier challenge banner, with the Biome logo over it
-socialImage: blog/prettier-challenge.png
+socialImage: ../../assets/blog/prettier-challenge.png
---
With the release of Biome **`v1.4.0`**, we claim the bounty of the [Prettier challenge](https://console.algora.io/challenges/prettier)!
diff --git a/website/src/content/config.ts b/website/src/content/config.ts
index 90e2a7cb1381..e273f1bc0448 100644
--- a/website/src/content/config.ts
+++ b/website/src/content/config.ts
@@ -1,38 +1,39 @@
import { docsSchema } from "@astrojs/starlight/schema";
// src/content/config.ts
-import { defineCollection, z } from "astro:content";
+import { type ImageFunction, defineCollection, z } from "astro:content";
-const blogSchema = z.object({
- title: z.string(),
- subtitle: z.string().optional(),
- pubDate: z
- .string()
- .or(z.date())
- .transform((val) => new Date(val)),
- summary: z.string(),
- description: z.string(),
- authors: z.array(z.string()),
- coverImage: z
- .object({
- src: z.string(),
- caption: z.string().optional(),
- alt: z.string(),
- })
- .optional(),
- socialImage: z.string(),
-});
+const blogSchema = (image: ImageFunction) =>
+ z.object({
+ title: z.string(),
+ subtitle: z.string().optional(),
+ pubDate: z
+ .string()
+ .or(z.date())
+ .transform((val) => new Date(val)),
+ summary: z.string(),
+ description: z.string(),
+ authors: z.array(z.string()),
+ coverImage: z
+ .object({
+ src: image(),
+ caption: z.string().optional(),
+ alt: z.string(),
+ })
+ .optional(),
+ socialImage: image(),
+ });
const authorsSchema = z.object({
name: z.string(),
avatar: z.string(),
- url: z.string().optional(),
+ url: z.string().url().optional(),
});
export const collections = {
docs: defineCollection({ schema: docsSchema() }),
blog: defineCollection({
type: "content",
- schema: blogSchema,
+ schema: ({ image }) => blogSchema(image),
}),
authors: defineCollection({
type: "data",
diff --git a/website/src/layouts/Blog.astro b/website/src/layouts/Blog.astro
index fb6c5ab8f447..9a13565e606c 100644
--- a/website/src/layouts/Blog.astro
+++ b/website/src/layouts/Blog.astro
@@ -1,6 +1,7 @@
---
import type { CollectionEntry } from "astro:content";
import BlogPostInfo from "@src/components/BlogPostInfo.astro";
+import { Image } from "astro:assets";
export interface Props {
post: CollectionEntry<"blog">["data"];
@@ -13,7 +14,7 @@ const { post } = Astro.props;
{
post.coverImage && (