engine

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// Templates stores the template data of all the pages of the site
	// Access the data for a particular page by using the relative path to the file as the key
	Templates map[template.URL]parser.TemplateData

	// K-V pair storing all templates correspoding to a particular tag in the site
	TagsMap map[string][]parser.TemplateData

	// Stores data parsed from layout/config.yml
	LayoutConfig parser.LayoutConfig

	// Posts contains the template data of files in the posts directory
	Posts []parser.TemplateData

	// Stores the index generated for search functionality
	JSONIndex map[template.URL]JSONIndexTemplate

	// Common logger for all engine functions
	ErrorLogger *log.Logger
}

func (*Engine) GenerateFeed

func (e *Engine) GenerateFeed()

func (*Engine) GenerateJSONIndex

func (e *Engine) GenerateJSONIndex(outFilePath string)

func (*Engine) GenerateSitemap

func (e *Engine) GenerateSitemap(outFilePath string)

func (*Engine) RenderEngineGeneratedFiles

func (e *Engine) RenderEngineGeneratedFiles(fileOutPath string, templ *template.Template)

func (*Engine) RenderPage

func (e *Engine) RenderPage(fileOutPath string, pagePath template.URL, pageTemplateData parser.TemplateData, templ *template.Template, templateStartString string)

fileOutPath for main.go should be refering to helpers.SiteDataPath

func (*Engine) RenderTags

func (e *Engine) RenderTags(fileOutPath string, templ *template.Template)

func (*Engine) RenderUserDefinedPages

func (e *Engine) RenderUserDefinedPages(fileOutPath string, templ *template.Template)

type JSONIndexTemplate

type JSONIndexTemplate struct {
	CompleteURL              template.URL
	FilenameWithoutExtension string
	Frontmatter              parser.Frontmatter
	Tags                     []string
}

This structure is solely used for storing the JSON index

Jump to

Keyboard shortcuts

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