engine

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 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 CollectionRootTemplateData

type CollectionRootTemplateData struct {
	DeepDataMerge   DeepDataMerge
	PageURL         template.URL
	TemplateData    parser.TemplateData
	CollectionNames []string
}

type DeepDataMerge

type DeepDataMerge 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

	// Templates stores the template data of all tag sub-pages of the site
	Tags map[template.URL]parser.TemplateData

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

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

	// Templates stores the template data of all collection sub-pages of the site
	Collections map[template.URL]parser.TemplateData

	// K-V pair storing all templates corresponding to a particular collection in the site
	CollectionsMap map[template.URL][]parser.TemplateData

	// K-V pair storing the template layout name for a particular collection in the site
	CollectionsSubPageLayouts map[template.URL]string

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

DeepDataMerge This struct holds all the ssg data

type Engine

type Engine struct {
	// Stores the merged ssg data
	DeepDataMerge DeepDataMerge

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

	// The path to the directory being rendered
	SiteDataPath string
}

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) RenderCollections

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

func (*Engine) RenderPage

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

RenderPage fileOutPath - stores the parent directory to store rendered files, usually `site/`

pagePath - stores the path to write the given page without the prefix directory Eg: site/content/posts/file1.html to be passed as posts/file1.html

template - stores the HTML templates parsed from the layout/ directory

templateStartString - stores the name of the template to be passed to ExecuteTemplate()

func (*Engine) RenderTags

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

func (*Engine) RenderUserDefinedPages

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

type JSONIndexTemplate

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

JSONIndexTemplate This structure is solely used for storing the JSON index

type PageData

type PageData struct {
	DeepDataMerge DeepDataMerge

	PageURL template.URL
}

type TagRootTemplateData

type TagRootTemplateData struct {
	DeepDataMerge DeepDataMerge
	PageURL       template.URL
	TemplateData  parser.TemplateData
	TagNames      []string
}

Jump to

Keyboard shortcuts

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