惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
博客园 - Franky
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
雷峰网
雷峰网
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More

The Astro Blog

Astro 6.4 Astro 6.3 Starlight 0.39 Astro 6.2 What's new in Astro - April 2026 What's new in Astro - March 2026 Astro 6.1 CloudCannon Joins Astro as an Official CMS Partner Astro 6.0 What's new in Astro - February 2026 What's new in Astro - January 2026 Astro 5.17 Supporting the future of Astro The Astro Technology Company joins Cloudflare Astro 6 Beta What's new in Astro - December 2025 What's new in Astro - November 2025 Astro 5.16 Stainless Sponsors Astro, Launches Astro-Powered Docs Platform What's new in Astro - October 2025 Astro 5.15 Spirit of Astro: meet the winning designs What's new in Astro - September 2025 Astro 5.14 Cloudflare Donates $150,000 to Support Astro's Open Source Mission Webflow Donates $150,000 to Support Astro's Open Source Mission Mux: Our Official Video Partner Unleashing creativity: How CodeTV built a video streaming platform with Astro and Mux | Astro What's new in Astro - August 2025 Astro 5.13
Astro x Storyblok: Content Loader
Matthew Phillips · 2024-09-19 · via The Astro Blog


We are thrilled to announce that Storyblok is a launch partner for the Astro Content Layer API, our new approach to bring remote and CMS data into content collections. Storyblok is a pioneer in headless CMS, featuring a built-in visual editor. It enables collaboration with marketers without hindering development teams from adopting emerging front-end technologies.

With the content layer you can now combine content from CMSes like Storyblok, alongside your local git-backed Markdown and MDX. With the Storyblok loader, you can sync your remote data in dev and get automatic refreshes as it changes.

Using the Storyblok loader

To use the new loader (in alpha), first install the @storyblok/astro package:

npm install @storyblok/astro@alpha

Then import and use the loader inside of your src/content/config.ts configuration file:

import { storyblokLoader } from "@storyblok/astro";

import { defineCollection } from "astro:content";

const storyblokCollection = defineCollection({

loader: storyblokLoader({

accessToken: import.meta.env.STORYBLOK_TOKEN,

version: "published",

}),

})

export const collections = {

storyblok: storyblokCollection,

}

And that’s it, from here you can query and use collections the same way you would for local collections. Storyblok comes with a StoryblokComponent that renders blocks for you. Here’s an example of how you might use it in a spread route.

---

import { getCollection } from "astro:content";

import StoryblokComponent from "@storyblok/astro/StoryblokComponent.astro";

import BaseLayout from "~/layouts/BaseLayout.astro";

import { type ISbStoryData } from "@storyblok/astro";

export async function getStaticPaths() {

const stories = await getCollection("storyblok");

return stories.map(({ data }: { data: ISbStoryData }) => {

return {

params: { slug: data.full_slug },

props: { story: data },

};

});

}

interface Props {

story: ISbStoryData;

}

const { story } = Astro.props;

---

<BaseLayout>

<StoryblokComponent blok={story.content} />

</BaseLayout>

See the Astro docs on content collections to learn more. Also check out yesterday’s deep dive on the Content Layer API to learn how loaders work, and how you can build your own, and the in alpha Storyblok’s loader GitHub repo to report issues and contribute.