Documentation
¶
Index ¶
- type Module
- func (m *Module) GetAsset(name string) (*models.ThemeAsset, error)
- func (m *Module) GetTemplate(theme, template string) (*models.ThemeTemplate, error)
- func (m *Module) GetTheme(name string) (*models.Theme, error)
- func (m *Module) Init(c *service.Config)
- func (m *Module) InstallThemeFromPackage(pkg *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) Render(w io.Writer, page *models.Page, contents map[string]interface{}) error
- func (m *Module) SearchRegistry(themeName string) (*packages.Package, error)
- func (m *Module) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- type ThemeStore
- 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 []ThemeStore // contains filtered or unexported fields }
Module templates provides support for looking up and using themes and their corresponding templates.
func (*Module) GetAsset ¶
func (m *Module) GetAsset(name string) (*models.ThemeAsset, error)
GetAsset searches all themes for the named asset
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 ¶
func (*Module) ListThemes ¶
ListThemes returns a list of all known 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) SearchRegistry ¶
type ThemeStore ¶
type ThemeStore interface { // List all themes in the store List() ([]*models.Theme, error) // Add a theme from a theme file Add(*models.Theme) error // Get a theme by name from the store Get(string) (*models.Theme, error) // Get a template for the given theme from the store GetTemplate(t *models.Theme, template string) (*models.ThemeTemplate, error) // Get an asset for the given theme from the store GetAsset(t *models.Theme, asset string) (*models.ThemeAsset, error) }
ThemeStore is a interface to support multiple theme backends.
type ThemesConfig ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.