Marketplace

cms

Other

togo CMS — headless content types, entries, pages & menus with draft/publish

togo-framework
bash
togo install togo-framework/cms

Install

bash
togo install togo-framework/cms

A headless CMS (Statamic / Wagtail-lite): define content types with typed fields, create entries validated against the type, draft → publish (with scheduled publish), route pages by slug, and build navigation menus. The public read API exposes only published content; the admin API sees everything.

Usage

go
c, _ := cms.FromKernel(k)

// 1. Define a content type
c.DefineType(cms.ContentType{Name: "article", Fields: []cms.Field{
    {Name: "title", Type: "text", Required: true},
    {Name: "body",  Type: "richtext"},
}})

// 2. Create an entry (draft, validated against the type)
e, _ := c.Create(cms.Entry{Type: "article", Slug: "hello-world",
    Fields: map[string]any{"title": "Hello", "body": "<p>Hi</p>"}})

// 3. Publish it (now, or schedule)
c.Publish(e.ID)                          // live now
c.Publish(e.ID, time.Now().Add(24*time.Hour)) // scheduled

// 4. Read a published page by slug
page, ok := c.Page("hello-world")

REST API

Method
Path
Description
GET/POST/api/cms/typeslist / define content types
GET/POST/api/cms/entrieslist (?type=&published=true) / create
POST/api/cms/entries/{id}/publishpublish an entry
DELETE/api/cms/entries/{id}delete
GET/api/cms/pages/{slug}public — published page by slug
GET/POST/api/cms/menuslist / set navigation menus
Rows per page
1–6 of 6
Page 1 of 1

Configuration

No required env. Content is held in a bounded in-memory store with a pluggable seam — swap a DB-backed store for persistence. Entries validate against their content type (required fields + no unknown fields).


<div align="center"> <h3>Premium sponsors</h3> <p> <a href="https://id8media.com"><strong>ID8 Media</strong></a> &nbsp;·&nbsp; <a href="https://one-studio.co"><strong>One Studio</strong></a> </p> <p><sub>Support togo — <a href="https://github.com/sponsors/fadymondy">become a sponsor</a>.</sub></p> </div>