Manual Install
@matthiesenxyz/ astro-ghostcms
Install
The Best way to install Astro-GhostCMS is from a fresh install. To get started run the following depending on your package manager of choice.
-
First create a new Astro install with the following command. Then delete the entire
/pages
folder under/src/
:Terminal window npm create astro@latestTerminal window pnpm create astro@latestTerminal window yarn create astro@latest -
Then run the following to install the package!
Astro add method npx astro add @matthiesenxyz/astro-ghostcmsManual pkg Install npm install @matthiesenxyz/astro-ghostcmsAstro add method pnpm astro add @matthiesenxyz/astro-ghostcmsManual pkg Install pnpm add @matthiesenxyz/astro-ghostcmsAstro add method yarn astro add @matthiesenxyz/astro-ghostcmsManual pkg Install yarn add @matthiesenxyz/astro-ghostcms -
Then set your
.env
variables to look like this:.env CONTENT_API_KEY=a33da3965a3a9fb2c6b3f63b48 -
Then set your
astro.config.mjs
to look like this:astro.config.mjs import { defineConfig } from "astro/config";import astroGhostCMS from '@matthiesenxyz/astro-ghostcms';// https://astro.build/configexport default defineConfig({site: "https://YOUR-DOMAIN-HERE.com"integrations: [astroGhostCMS({// `ghostURL` Recommended to set here, Can also set in .env as CONTENT_API_URLghostURL: "https://ghostdemo.matthiesen.xyz",})],}); -
This is how your file structure should look:
Directoryyour-awesome-project/
Directorypublic/
- …
Directorysrc/
- …
- .env
- astro.config.mjs
- package.json
-
Then run the following to start your Astro server:
Terminal window npm run devTerminal window pnpm run devTerminal window yarn run dev
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 |
/404 | 404 Page |
/[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 |
/rss.xml | All the posts, in a FEED |