@onhive.io/astro-loader
Version:
Astro Content Layer loader for the Hive blockchain
58 lines (39 loc) • 1.96 kB
Markdown
[](https://npmjs.com/package/@onhive.io/astro-loader)
[](https://codecov.io/gh/instytutfi/hive-astro-loader)
[](https://github.com/instytutfi/hive-astro-loader/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)
[](https://ecency.com/@hive.coding)

# Hive Astro Loader
Astro Content Layer loader for the Hive blockchain
## Installation
```bash
npm install @onhive.io/astro-loader
```
Or use our favorite package manager.
## Usage
In your Astro project, edit the `/src/content/config.ts` and define any collections using the loaders
that this package provides:
### Hive Blog Loader
```ts
import { defineCollection } from "astro:content";
import { hiveBlogLoader, hiveAccountsLoader } from "@onhive.io/astro-loader";
export const collections = {
blog: defineCollection({
type: "content_layer",
loader: hiveBlogLoader("hive.coding") // Selected username
}),
accounts: defineCollection({
type: "content_layer",
loader: hiveAccountsLoader("hive.coding") // or ["acc1", "acc2"] for multiple accounts
})
};
```
## Learn more
- [Astro](https://astro.build/)
- [Content Layer API](https://astro.build/blog/content-layer-deep-dive/)
## Support
If you have any questions or need help, please join our [Discord server](https://discord.gg/3u9v7b4w).
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.