https://github.com/writeas/go-ghost
Go library for the Ghost API
https://github.com/writeas/go-ghost
ghost-api go
Last synced: 2 months ago
JSON representation
Go library for the Ghost API
- Host: GitHub
- URL: https://github.com/writeas/go-ghost
- Owner: writeas
- License: mit
- Created: 2019-02-26T23:22:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-03T20:46:41.000Z (9 months ago)
- Last Synced: 2025-04-09T02:12:16.298Z (3 months ago)
- Topics: ghost-api, go
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 9
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-ghost
[](https://pkg.go.dev/github.com/writeas/go-ghost)
go-ghost is a Go (golang) library for accessing the Ghost API.
This library is **incomplete**, and tailored toward our [Write.as](https://write.as) / [WriteFreely](https://writefreely.org) integration. But contributions (including those to support the full Ghost API) are welcome!
## Install
```text
go get -u github.com/writeas/go-ghost
```## Usage
Create a post:
```go
import (
"github.com/writeas/go-ghost"
"github.com/writeas/go-ghost/admin"
)func main() {
// NewClient takes your Ghost URL and admin API key
c := ghost.NewClient("http://localhost:2368", "fc765549cb7e9d05d5ecf2c9:d3e6d27fcf782ceebea59024010aec...")
err := admin.AddPost(c, ghost.PostParams{
Title: ghost.String("My Post Title"),
Markdown: ghost.String(`This is a **test post** made with the [go-ghost](https://github.com/writeas/go-ghost) library.`),
Status: ghost.String("published"),
})
if err != nil {
// Handle error
}
}
```