template

package
v0.0.0-...-7b0100a Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeuboTemplateRenderer

type BeuboTemplateRenderer struct {
	T               *template.Template
	PluginHandler   *plugin.Handler
	ReloadTemplates bool
	CurrentTheme    string
	ThemeDir        string
	DB              *gorm.DB
}

BeuboTemplateRenderer holds all the configuration variables for rendering templates in Beubo

func (*BeuboTemplateRenderer) GetPageTemplates

func (btr *BeuboTemplateRenderer) GetPageTemplates() map[string]string

GetPageTemplates recursively parses the themes directory to find all theme files

func (*BeuboTemplateRenderer) GetThemes

func (btr *BeuboTemplateRenderer) GetThemes() map[string]string

GetThemes fetches all the themes in the theme directory as strings

func (*BeuboTemplateRenderer) Init

func (btr *BeuboTemplateRenderer) Init()

Init prepares the BeuboTemplateRenderer to render pages with html templates

func (*BeuboTemplateRenderer) RenderHTMLPage

func (btr *BeuboTemplateRenderer) RenderHTMLPage(w http.ResponseWriter, r *http.Request, pageData structs.PageData)

RenderHTMLPage handles rendering of the html template and should be the last function called before returning the response

Jump to

Keyboard shortcuts

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