Skip to content

A collection of TypeScript packages and tools to interact with a ghost blog. Type-safe 🦾 Ghost Content API client and CLI πŸ€– tool to export posts in Markdown.

License

Notifications You must be signed in to change notification settings

PhilDL/ts-ghost

Repository files navigation



Logo

ts-ghost

@ts-ghost is a collection of tools written in TypeScript to interract with a Ghost Blog. Strongly 🦾 typed Content-Api, Cli tools, and more coming!

Documentation – Twitter

License GitHub top language

About The Project

Ghost is an amazing open source blogging platform. Beautiful CMS and good API but there is lack of strongly types TypeScript libraries to interact with its API. This is where the ts-ghost suite comes in.

Here you will find links to the different packages of the ts-ghost suite.

An elegant cli πŸ€– to interact with your Ghost Blog directly via the Ghost Content API or Admin API and export posts in Markdown format. From the cli you will be able to:

npx @ts-ghost/ghost-blog-buster

or

npm install -g @ts-ghost/ghost-blog-buster
  • πŸŒͺ️ Choose between Content API or Admin API (for members or blog post content behind subscribption)
  • πŸ“š Export specific or all blog Posts in Markdown format to the folder of your choice.
  • βš™οΈ Display or export to JSON your Tags, Tiers, Authors, Members (Admin API only)
  • πŸ“Ά Connect / Disconnect from the Blog
  • Documentation β€” GitHub β€” npm

A strongly 🦾 typed TypeScript library to interact with the Ghost Content API:

npm install @ts-ghost/content-api
  • Browse and Read your blog Posts, Pages, Tags, Tiers, Authors and Settings
  • Type-safe Inputs/Outputs.
  • Models schema and run-type safety with Zod.
  • Documentation β€” GitHub β€” npm

A strongly 🦾 typed TypeScript library to interact with the Ghost Admin API:

npm install @ts-ghost/admin-api
  • Browse/Read/Add/Edit/Delete your blog Posts, Pages, Members, Tags, Tiers, Offers, Newsletters, Users, webhooks, Site, ...
  • Type-safe Inputs/Outputs for all CRUD methods.
  • Models schema and run-type safety with Zod.
  • Documentation β€” GitHub β€” npm

The base building block containing the APIComposer and Fetchers (Browse / Read / Mutations) accepting Zod Schemas.

npm install @ts-ghost/core-api
  • Input type-safety of the Ghost API params
  • Modify Type Output based on Input params
  • Documentation β€” GitHub β€” npm

Roadmap

  • Ghost Admin API integration
  • Better handling of weird Ghost "include" params in API call

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
  • Please make sure you check your spelling and grammar.
  • Create individual PR for each suggestion.
  • Please also read through the Code Of Conduct before posting your first idea as well.

License

Distributed under the MIT License. See LICENSE for more information.

Authors

Acknowledgements

  • Ghost is the best platform for blogging πŸ’– and have a good JS Client library that was a real inspiration.
  • Zod is a TypeScript-first library for data validation and schema building.
  • Clack to build beautiful prompts.