astro-ghostcms/README.md

44 lines
1.3 KiB
Markdown
Raw Normal View History

2024-01-13 07:20:44 +00:00
# Welcome to Astro-GhostCMS
This addon uses the `@tryghost/content-api` and creates astro friendly functions to interface between ghost and astro.
2024-01-13 07:45:04 +00:00
This package contains a independent copy of the tryghost content-api.js that is used to establish the connection so this package dose not depend on `@tryghost/content-api` package.
## Installation
```
npm install @adammatthiesen/astro-ghostcms
```
Must create `.env` with the following:
```env
CONTENT_API_KEY=
CONTENT_API_URL=
```
Astro minimum Version: **Astro v4.0**
Dependencies:
- **Axios v1.0** *Will be auto installed*
- **Typescript v5.3.3** *Will be auto installed*
## Work In Progress README (*More Information will be provided as time goes on...*)
Basic Usage:
2024-01-15 02:32:41 +00:00
```
import { getGhostPosts } from "@adammatthiesen/astro-ghostcms";
```
2024-01-13 07:45:04 +00:00
- getGhostPosts() - Get list of posts
- getGhostRecentPosts(setLimit?) - Get Recent Posts (setLimit={6})
- getGhostFeaturedPosts(setLimit?) - Get Featured Posts (setLimit={1})
- getGhostPostbySlug(slug) - Get Post by Slug
- getGhostPostsbyTag(slug) - Get Posts list by Tag slug
- getGhostTags() - Get list of tags
- getGhostTagbySlug(slug) - Get Tag by slug
- getGhostAuthors() - Get list of Authors
- getGhostPages() - Get list of Pages
- getGhostPage(slug) - Get page by slug
- getGhostSettings() - Get Settings for GhostCMS