shared

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ERROR_LOGGER_IS_NIL = "logger cannot be nil"
View Source
const ERROR_STORE_IS_NIL = "store cannot be nil"
View Source
const KeyAdminHomeURL = "admin_home_uRL"
View Source
const KeyEndpoint = "endpoint"
View Source
const PathBlocksBlockCreate = "/blocks/block-create"
View Source
const PathBlocksBlockDelete = "/blocks/block-delete"
View Source
const PathBlocksBlockManager = "/blocks/block-manager"
View Source
const PathBlocksBlockUpdate = "/blocks/block-update"
View Source
const PathHome = "/"
View Source
const PathMenusMenuCreate = "/menus/menu-create"
View Source
const PathMenusMenuDelete = "/menus/menu-delete"
View Source
const PathMenusMenuManager = "/menus/menu-manager"
View Source
const PathMenusMenuUpdate = "/menus/menu-update"
View Source
const PathPagesPageCreate = "/pages/page-create"
View Source
const PathPagesPageDelete = "/pages/page-delete"
View Source
const PathPagesPageManager = "/pages/page-manager"
View Source
const PathPagesPageUpdate = "/pages/page-update"
View Source
const PathPagesPageVersioning = "/pages/page-versioning"
View Source
const PathSitesSiteCreate = "/sites/site-create"
View Source
const PathSitesSiteDelete = "/sites/site-delete"
View Source
const PathSitesSiteManager = "/sites/site-manager"
View Source
const PathSitesSiteUpdate = "/sites/site-update"
View Source
const PathTemplatesTemplateCreate = "/templates/template-create"
View Source
const PathTemplatesTemplateDelete = "/templates/template-delete"
View Source
const PathTemplatesTemplateManager = "/templates/template-manager"
View Source
const PathTemplatesTemplateUpdate = "/templates/template-update"
View Source
const PathTranslationsTranslationCreate = "/translations/translation-create"
View Source
const PathTranslationsTranslationDelete = "/translations/translation-delete"
View Source
const PathTranslationsTranslationManager = "/translations/translation-manager"
View Source
const PathTranslationsTranslationUpdate = "/translations/translation-update"

Variables

This section is empty.

Functions

func AdminBreadcrumbs added in v0.9.0

func AdminBreadcrumbs(r *http.Request, pageBreadcrumbs []Breadcrumb, options struct {
	SiteList []cmsstore.SiteInterface
}) hb.TagInterface

func AdminHeader added in v0.9.0

func AdminHeader(store cmsstore.StoreInterface, logger *slog.Logger, r *http.Request) hb.TagInterface

func AdminHomeURL added in v0.10.0

func AdminHomeURL(r *http.Request) string
func Breadcrumbs(breadcrumbs []Breadcrumb) hb.TagInterface

func CachedSiteByID added in v0.13.0

func CachedSiteByID(ctx context.Context, store cmsstore.StoreInterface, siteID string) (cmsstore.SiteInterface, error)

CachedSiteFindByID returns a site by ID, caching the result for 2 minutes

func CachedSiteList added in v0.13.0

func CachedSiteList(ctx context.Context, store cmsstore.StoreInterface) ([]cmsstore.SiteInterface, error)

CachedSiteList returns a list of all sites, caching the result for 2 minutes

func CachedSiteURL added in v0.13.0

func CachedSiteURL(r *http.Request, store cmsstore.StoreInterface, siteID string) (string, error)

CachedSiteURL returns a site URL, caching the result for 2 minutes

func CachedSitesActive added in v0.13.0

func CachedSitesActive(ctx context.Context, store cmsstore.StoreInterface) ([]cmsstore.SiteInterface, error)

CachedSitesActive returns a list of active sites, caching the result for 2 minutes

func Endpoint added in v0.7.0

func Endpoint(r *http.Request) string

func FilterDescriptionSite added in v0.13.0

func FilterDescriptionSite(ctx context.Context, store cmsstore.StoreInterface, siteID string) hb.TagInterface

func PageURL added in v0.13.0

func PageURL(r *http.Request, store cmsstore.StoreInterface, storeID string, pageAlias string) (string, error)

func URL added in v0.7.0

func URL(endpoint string, path string, params map[string]string) string

func URLR added in v0.11.0

func URLR(r *http.Request, path string, params map[string]string) string

Types

type Admin added in v0.10.0

type Admin interface {
	Handle(w http.ResponseWriter, r *http.Request)
}
type Breadcrumb struct {
	Name string
	URL  string
}

type UiConfig added in v0.9.0

type UiConfig struct {
	BlockEditorDefinitions []blockeditor.BlockDefinition
	// Endpoint               string
	Layout func(w http.ResponseWriter, r *http.Request, webpageTitle, webpageHtml string, options struct {
		Styles     []string
		StyleURLs  []string
		Scripts    []string
		ScriptURLs []string
	}) string
	Logger *slog.Logger
	Store  cmsstore.StoreInterface
}

type UiInterface added in v0.9.0

type UiInterface interface {
	Layout(w http.ResponseWriter, r *http.Request, webpageTitle, webpageHtml string, options struct {
		Styles     []string
		StyleURLs  []string
		Scripts    []string
		ScriptURLs []string
	}) string
	Logger() *slog.Logger
	Store() cmsstore.StoreInterface
}

Jump to

Keyboard shortcuts

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