- docs/setup/coming-from-wintercms.md maps WinterCMS concepts to checked pkg.Ident spans and lists what SummerCMS does not provide - party BlogPlugin and ExamplePlugin, shown through src= fences - TestDocsRequiredPages asserts required pages build as .html and .md - index links the new page
35 lines
1.2 KiB
Go
35 lines
1.2 KiB
Go
package party_test
|
|
|
|
import (
|
|
"git.golem15.com/golem15/summercms/modules/backpack"
|
|
"git.golem15.com/golem15/summercms/modules/pact"
|
|
)
|
|
|
|
// BlogPlugin is the acme.blog plugin: the Go form of a WinterCMS Plugin.php.
|
|
// A real plugin package also registers it from init with
|
|
// party.Register(&BlogPlugin{}).
|
|
type BlogPlugin struct{}
|
|
|
|
// The optional capabilities the plugin opts into, checked at compile time.
|
|
var _ pact.HasPermissions = (*BlogPlugin)(nil)
|
|
|
|
// ID is the plugin identifier in vendor.plugin form.
|
|
func (p *BlogPlugin) ID() string { return "acme.blog" }
|
|
|
|
// Requires lists the plugins that must register and boot first ($require).
|
|
func (p *BlogPlugin) Requires() []string { return []string{"acme.user"} }
|
|
|
|
// Register runs before any plugin boots: publish services here.
|
|
func (p *BlogPlugin) Register(app *backpack.App) error { return nil }
|
|
|
|
// Boot runs after every plugin registered: listen to events and look up
|
|
// services other plugins published.
|
|
func (p *BlogPlugin) Boot(app *backpack.App) error { return nil }
|
|
|
|
// Permissions replaces registerPermissions().
|
|
func (p *BlogPlugin) Permissions() []pact.Permission {
|
|
return []pact.Permission{
|
|
{Code: "acme.blog.access_posts", Tab: "Blog", Label: "Manage posts"},
|
|
}
|
|
}
|