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

推荐订阅源

博客园 - 聂微东
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
C
Check Point Blog
M
MIT News - Artificial intelligence
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
D
Docker
Last Week in AI
Last Week in AI
IT之家
IT之家
F
Fortinet All Blogs
A
About on SuperTechFans
P
Proofpoint News Feed
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
博客园_首页
月光博客
月光博客
博客园 - 司徒正美
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 Cloudinary: Content Loader
Matthew Phillips · 2024-09-19 · via The Astro Blog

We are thrilled to announce Cloudinary as a launch partner for the Astro Content Layer API, our new approach to bringing external content into content collections. Cloudinary is a hosting platform for media assets that allows you to transform and optimize media types.

Content collections are Astro’s answer to organized, managed, type-safe content. Now with Astro’s content layer, you can bring in all different types of content and data from external sources during the build. The Content Layer API efficiently syncs and caches the content, giving you a familiar, unified experience for working with any data source.

Using the Cloudinary loader

To use the new loader, first install the astro-cloudinary package from npm:

npm install astro-cloudinary

Next, you’ll need to configure your environment with your API key. See the Cloudinary loader configuration guide for details.

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

import { defineCollection } from 'astro:content'

import { cldAssetsLoader } from 'astro-cloudinary/loaders'

const samples = defineCollection({

loader: cldAssetsLoader({

limit: 4,

folder: 'samples/food'

})

})

export const collections = { assets }

And that’s it! From here, you can query and use collections the same way you would for local collections. See the Astro docs content collections guide to learn more.

For more reading on using the Cloudinary loader, go read Source Cloudinary Assets in Astro With the Astro Content Layer which has additional details. Also check out yesterday’s deep dive on the new Content Layer API to learn how loaders work, and how you can build your own.