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

推荐订阅源

C
Check Point Blog
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
博客园_首页
博客园 - 【当耐特】
WordPress大学
WordPress大学
月光博客
月光博客
博客园 - 叶小钗
S
SegmentFault 最新的问题
雷峰网
雷峰网
H
Help Net Security
宝玉的分享
宝玉的分享
A
About on SuperTechFans
IT之家
IT之家
J
Java Code Geeks
Hugging Face - Blog
Hugging Face - Blog
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog

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.