New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

astro-ghostcms-loader

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-ghostcms-loader

This package provides a GhostCMS loader for astro. Allowing ease of use of all your GhostCMS content within astro's built in Content Layer!

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
0
Weekly downloads
 
Created
Source

astro-ghostcms-loader

This package provides a GhostCMS loader for astro. Allowing ease of use of all your GhostCMS content within astro's built in Content Layer!

Installation

npm install astro-ghostcms-loader

Usage

Requirements

To use this loader, it is required that you be on at least Astro v5.0.0

Also make sure to create and set your .env file with the following:

GHOST_CONTENT_API_KEY=your_api_key_here

Config

In src/content.config.ts, import and configure the loaderCollection:

import { GhostCMSLoaderCollection} from 'astro-ghostcms-loader';

export const collections = {
  ...GhostCMSLoaderCollection({
    ghostUrl: 'https://demo.ghost.io' // Your GhostCMS Instance URL
    apiVersion?: 'v5.0' // OPTIONAL - Allows you to define a specific version (min: v5.0)
  }),
}

Calling the created GhostCMS collections

Query the content collection like any other Astro content collection entry:

import { getCollection } from "astro:content"

const pages = await getCollection("ghostPages"); // Supports the render() function from astro
const posts = await getCollection("ghostPosts"); // Supports the render() function from astro
const tags = await getCollection("ghostTags");
const authors = await getCollection("ghostAuthors");
const tiers = await getCollection("ghostTiers");
const settings = await getEntry('ghostSettings', 'settings');

Changelog

See the Changelog for the change history of this loader.

Contribution

If you see any errors or room for improvement, feel free to open an issues or pull request . Thank you in advance for contributing! ❤️

Keywords

FAQs

Package last updated on 08 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc