Overview
Nuxt Content Assets is a module that enables locally-located assets in Nuxt Content. It allows you to reference assets with relative paths in your documents, and at build time, the module collates and serves assets and content together.
Features
- User experience:
- Co-locate assets with content files
- Reference assets using relative paths
- Supports any format (image, video, doc)
- Developer experience:
- Works with tags and custom components
- Works in markdown and frontmatter
- File watching and asset live-reload
- Image size injection
- Zero config
Installation
To install the module, follow these steps:
- Install the dependency:
npm install nuxt-content-assets
- Configure
nuxt.config.ts:
// nuxt.config.ts
export default {
modules: ['nuxt-content-assets'],
// other configurations...
}
- Run the dev server or build, and local assets should now be served alongside markdown content.
Summary
Nuxt Content Assets is a powerful module that enhances the user and developer experience when working with locally-located assets in Nuxt Content. It allows you to easily reference assets with relative paths, supports various formats, and provides features like file watching and live-reload. With zero configuration required, it seamlessly integrates with any Nuxt Content project or theme.