content

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package content defines a finite block and rich-text publishing application.

Index

Constants

This section is empty.

Variables

View Source
var CTA = field.Block{
	Slug: "cta", Labels: field.BlockLabels{Singular: "CTA"}, TypeName: "CTA",
	Admin: field.BlockAdmin{RowLabelPath: "label"},
	Fields: field.Fields{
		field.Text("label").Required().Localized(),
		field.Relationship("destination", "pages"),
	},
}
View Source
var Callout = field.Block{
	Slug: "callout", TypeName: "Callout",
	Admin: field.BlockAdmin{RowLabelPath: "title"},
	Fields: field.Fields{
		field.Text("title").Required(),
		field.Textarea("message").Localized(),
		richtext.Field("detail", richtext.Config{Blocks: []field.Block{CTA}}),
		richtext.Field("aside"),
	},
}

Callout contains two independent finite editors. The inner editor accepts CTA, whose fields do not refer back to Callout, so the schema has no recursion.

View Source
var Content = field.Block{
	Slug: "content", TypeName: "Content",
	Admin: field.BlockAdmin{RowLabelPath: "title"},
	Fields: field.Fields{
		field.Text("title").Localized(),
		richtext.Field("body"),
		field.Array("links", field.Fields{field.Text("label").Required(), field.Text("href").Required()}),
	},
}
View Source
var Hero = field.Block{
	Slug: "hero", TypeName: "Hero",
	Admin: field.BlockAdmin{RowLabelPath: "heading"},
	Fields: field.Fields{
		field.Text("heading").Required().Localized(),
		field.Group("appearance", field.Fields{
			field.Select("tone", "light", "dark"),
		}),
	},
}

Hero is reused by both pages and campaigns. TypeName affects generated symbols, while the stable slug is the stored discriminator.

View Source
var Media = field.Block{
	Slug: "media", TypeName: "Media",
	Admin: field.BlockAdmin{RowLabelPath: "caption"},
	Fields: field.Fields{
		field.Relationship("asset", "assets").Required(),
		field.Text("caption").Localized(),
	},
}

Functions

func Config

func Config() ridu.Config

Config is ordinary executable application configuration, independent of storage.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL