Documentation ¶
Index ¶
- type Module
- func (m *Module) CheckThemeForUpdate(name string) (bool, string, string, error)
- func (m *Module) GetAsset(name string) (*models.ThemeAsset, error)
- func (m *Module) GetRegistryURL() string
- func (m *Module) GetTemplate(theme, template string) (*models.ThemeTemplate, error)
- func (m *Module) GetTheme(name string) (*models.Theme, string, error)
- func (m *Module) Init(c *service.Config)
- func (m *Module) InstallThemeFromPackage(p *packages.Package) error
- func (m *Module) ListThemes() ([]*models.Theme, error)
- func (m *Module) NotFound(rw http.ResponseWriter, req *http.Request)
- func (m *Module) Registry() (*packages.Registry, error)
- func (m *Module) RenderPage(w io.Writer, page *models.Page, context *context.EngineContext) error
- func (m *Module) SearchRegistry(themeName string) (*packages.Package, error)
- func (m *Module) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (m *Module) UpdateTheme(name, ref string) error
- type ThemesConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct { ConfigModule *config.Module Logger *logger.Module Pkg *pkg.Module Stores []store.ThemeStore // contains filtered or unexported fields }
Module templates provides support for looking up and using themes and their corresponding templates.
func (*Module) CheckThemeForUpdate ¶ added in v0.2.0
CheckThemeForUpdate checks the given theme for updates, and if it has updates, returns true, and the current ref and the latest ref.
func (*Module) GetAsset ¶
func (m *Module) GetAsset(name string) (*models.ThemeAsset, error)
GetAsset searches all installed themes for the named asset
func (*Module) GetRegistryURL ¶ added in v0.2.0
GetRegistryURL returns the configured registry URL
func (*Module) GetTemplate ¶
func (m *Module) GetTemplate(theme, template string) (*models.ThemeTemplate, error)
GetTemplate returns the template for the given theme and template.
func (*Module) InstallThemeFromPackage ¶
InstallThemeFromPackage to the default store from a remote git. todo: check for existing package
func (*Module) ListThemes ¶
ListThemes returns a list of all installed themes.
func (*Module) NotFound ¶
func (m *Module) NotFound(rw http.ResponseWriter, req *http.Request)
NotFound serves a 404 page from a 404.html asset, if it exists.
func (*Module) RenderPage ¶ added in v0.2.0
Render a page using the theme and template specified therein.
func (*Module) SearchRegistry ¶
SearchRegistry searches the registry for the given theme name.
func (*Module) ServeHTTP ¶
func (m *Module) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP serves theme assets