![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
fake-astro-loader
Advanced tools
fake-astro-loader lets you load any content you want into your Astro content collections. You define the shape of your data using Zod schemas, and fake-astro-loader will generate the data for you using LLMs like gpt-4o-mini
. It's useful during the prototyping phase when you don't have real data yet.
npm install fake-astro-loader
fake-astro-loader currently supports the following AI providers for generating data:
To use fake-astro-loader, obtain an API key from one of these providers. Once you have it, set it as an environment variable, either OPENAI_API_KEY
or ANTHROPIC_API_KEY
, using the export
command. For example:
export OPENAI_API_KEY=your-api-key
Additionally, you need to use Astro v4.14.0 or later to use fake-astro-loader. Enable the experimental content layer in your astro.config.mjs
:
export default defineConfig({
experimental: {
contentLayer: true,
},
});
Now you can define your content collection in src/content/config.ts
:
import { defineCollection, z } from "astro:content";
import { fakeLoader } from "fake-astro-loader";
const fakeBlog = defineCollection({
loader: fakeLoader({
modelId: "gpt-4o-mini",
prompt: "Generate 5 blog posts about Astro.",
schema: z.object({
slug: z.string(),
title: z.string(),
description: z.string(),
pubDate: z.coerce.date(),
}),
}),
});
export const collections = { fakeBlog };
If you want to generate HTML content for the collection, add a rendered
field to your schema and set it to z.string()
. Then, update the prompt to instruct the model to include HTML content in the field. After that, you can use the render
function to display the HTML content on a page.
There's a demo project in the playground
directory, so feel free to check it out to see how to use fake-astro-loader.
schema
: A Zod schema that defines the shape of your data.prompt
: A prompt that describes what kind of data you want to generate.modelId
: A model ID to use for generating the data. Defaults to gpt-4o-mini
.FAQs
Fake Content Loader for Astro Content Layer
We found that fake-astro-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.