Skip to content

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.

  1. First create a new Astro install with the following command. Then delete the entire /pages folder under /src/:

    Terminal window
    npm create astro@latest
  2. Then run the following to install the package!

    Astro add method
    npx astro add @matthiesenxyz/astro-ghostcms
    Manual pkg Install
    npm install @matthiesenxyz/astro-ghostcms
  3. Then set your .env variables to look like this:

    .env
    CONTENT_API_KEY=a33da3965a3a9fb2c6b3f63b48
  4. 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/config
    export default defineConfig({
    site: "https://YOUR-DOMAIN-HERE.com"
    integrations: [
    astroGhostCMS({
    // `ghostURL` Recommended to set here, Can also set in .env as CONTENT_API_URL
    ghostURL: "https://ghostdemo.matthiesen.xyz",
    })
    ],
    });
  5. This is how your file structure should look:

    • Directoryyour-awesome-project/
      • Directorypublic/
      • Directorysrc/
      • .env
      • astro.config.mjs
      • package.json
  6. Then run the following to start your Astro server:

    Terminal window
    npm run dev

Created Routes

The routes are the same as a standard Ghost Blog so you can migrate to Astro easily.

RouteContent
/Homepage with recents/features Blog Posts
/404404 Page
/[slug]Post or Page
/author/[slug]Author page with related posts
/authorsAll the authors
/tag[slug]Tag page with related posts
/tagsAll the tags
/archives/[...page]All the posts, paginated
/rss.xmlAll the posts, in a FEED