diff --git a/README.md b/README.md index 250b177d..0a097eaf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Astro minimum Version: **Astro v4.0** -This addon uses the `@tryghost/content-api` and creates astro friendly functions to interface between ghost and astro. +This Integration is 2 parts. Firstly, there is the API portion that uses the `@tryghost/content-api` to create the link between astro and GhostCMS. From there we move to the Second Part, which is a theme pre-programmed to pull ALL of its data from GhostCMS iteself instead of storing any local data. *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.* @@ -10,18 +10,67 @@ This addon uses the `@tryghost/content-api` and creates astro friendly functions In this mode, the addon will not be just an API, but will be a full Route takeover, there is plans to add more themes in time, but for now there is only the base Casper theme based on Ghost's main Theme. +### Astro Add Installation *(Coming Soon)* + ``` # NOT READY YET DO NOT USE astro add @matthiesenxyz/astro-ghostcms ``` -## Manual Installation +### Manual Installation ``` npm i @matthiesenxyz/astro-ghostcms ``` -Must create `.env` with the following: +Then set your astro.config.ts to look like this: + +``` +import { defineConfig } from "astro/config"; +import sitemap from "@astrojs/sitemap"; +import GhostCMS from '@matthiesenxyz/astro-ghostcms'; + +// https://astro.build/config +export default defineConfig({ + site: "https://YOUR-DOMAIN-HERE.com" + integrations: [sitemap(), GhostCMS()], +}); +``` +### Dont forget to set your environment Variables! + +You must also create 2 environment variables in a `.env` file with the following: + +```env +CONTENT_API_KEY=a33da3965a3a9fb2c6b3f63b48 +CONTENT_API_URL=https://ghostdemo.matthiesen.xyz +``` + +**When you deploy your install dont forget to set the above ENVIRONMENT VARIABLES!** + +#### Created Routes + +The routes are the same as a standard Ghost Blog so you can migrate to Astro easily. + +| Route | Content | +| --------------------- | ----------------------------------------- | +| `/` | Homepage with recents/features Blog Posts | +| `/[slug]` | Post or Page | +| `/author/[slug]` | Author page with related posts | +| `/authors` | All the authors | +| `/tag[slug]` | Tag page with related posts | +| `/tags` | All the tags | +| `/archives/[...page]` | All the posts, paginated | + + +## Manual Function Mode (DIY MODE) + +In this mode the integration will not deploy routes at all. you will have to build your own website to utilize the exported functions listed below. + +``` +npm i @matthiesenxyz/astro-ghostcms +``` + +You must also create 2 environment variables in a `.env` file with the following: ```env CONTENT_API_KEY=a33da3965a3a9fb2c6b3f63b48