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 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.