update to 1.0.0, code cleanup
This commit is contained in:
parent
44c3c5a1de
commit
be76428aae
|
@ -27,6 +27,10 @@ Dependencies:
|
||||||
|
|
||||||
Basic Usage:
|
Basic Usage:
|
||||||
|
|
||||||
|
```
|
||||||
|
import { getGhostPosts } from "@adammatthiesen/astro-ghostcms";
|
||||||
|
```
|
||||||
|
|
||||||
- getGhostPosts() - Get list of posts
|
- getGhostPosts() - Get list of posts
|
||||||
- getGhostRecentPosts(setLimit?) - Get Recent Posts (setLimit={6})
|
- getGhostRecentPosts(setLimit?) - Get Recent Posts (setLimit={6})
|
||||||
- getGhostFeaturedPosts(setLimit?) - Get Featured Posts (setLimit={1})
|
- getGhostFeaturedPosts(setLimit?) - Get Featured Posts (setLimit={1})
|
||||||
|
|
2
index.ts
2
index.ts
|
@ -1,5 +1,5 @@
|
||||||
// FUNCTION EXPORTS
|
// FUNCTION EXPORTS
|
||||||
export { getGhostPosts, getGhostRecentPosts, getGhostFeaturedPosts, getGhostPostbySlug, getGhostPostsbyTag, getGhostTags, getGhostTagbySlug, getGhostAuthors, getGhostPages, getGhostPage, getGhostSettings } from './src/ghost';
|
export { getGhostPosts, getGhostRecentPosts, getGhostFeaturedPosts, getGhostPostbySlug, getGhostPostsbyTag, getGhostTags, getGhostTagbySlug, getGhostAuthors, getGhostPages, getGhostPage, getGhostSettings } from './src/functions';
|
||||||
|
|
||||||
// TYPE EXPORTS
|
// TYPE EXPORTS
|
||||||
export type { PostOrPage, ArrayOrValue, Author, Authors, BrowseFunction, CodeInjection, Excerpt, Facebook, FieldParam, FilterParam, FormatParam, GhostAPI, GhostContentAPIOptions, GhostData, GhostError, Identification, IncludeParam, LimitParam, Metadata, Nullable, OrderParam, PageParam, Pagination, Params, PostsOrPages, ReadFunction, Settings, SettingsResponse, SocialMedia, Tag, TagVisibility, Tags, Twitter } from './index.d';
|
export type { PostOrPage, ArrayOrValue, Author, Authors, BrowseFunction, CodeInjection, Excerpt, Facebook, FieldParam, FilterParam, FormatParam, GhostAPI, GhostContentAPIOptions, GhostData, GhostError, Identification, IncludeParam, LimitParam, Metadata, Nullable, OrderParam, PageParam, Pagination, Params, PostsOrPages, ReadFunction, Settings, SettingsResponse, SocialMedia, Tag, TagVisibility, Tags, Twitter } from './index.d';
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@adammatthiesen/astro-ghostcms",
|
"name": "@adammatthiesen/astro-ghostcms",
|
||||||
"description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content",
|
"description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content",
|
||||||
"version": "0.0.1-beta.3",
|
"version": "1.0.0",
|
||||||
"author": "Adam Matthiesen <adam@matthiesen.xyz>",
|
"author": "Adam Matthiesen <adam@matthiesen.xyz>",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
// IMPORT Ghost Types
|
// IMPORT Ghost Types
|
||||||
import type { PostOrPage, PostsOrPages, Authors, Tag, Tags, ArrayOrValue, IncludeParam, LimitParam, Settings, Nullable } from '../index.d';
|
import type { PostOrPage, PostsOrPages, Authors, Tag, Tags, ArrayOrValue, IncludeParam, LimitParam, Settings, Nullable } from '..';
|
||||||
|
|
||||||
// IMPORT Ghost API Client
|
// IMPORT Ghost API Client
|
||||||
import { api } from './Content-API/api-client';
|
import { api } from './interface';
|
||||||
|
|
||||||
// SET Include params
|
// SET Include params
|
||||||
const include:ArrayOrValue<IncludeParam> = ['authors', 'tags'];
|
const include:ArrayOrValue<IncludeParam> = ['authors', 'tags'];
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import GhostContentAPI from './ghostContentAPI';
|
import GhostContentAPI from './tryghost-content-api';
|
||||||
|
|
||||||
// CALL GHOST VARS AND CREATE CLIENT
|
// CALL GHOST VARS AND CREATE CLIENT
|
||||||
const key = import.meta.env.CONTENT_API_KEY;
|
const key = import.meta.env.CONTENT_API_KEY;
|
Loading…
Reference in New Issue