engine

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 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 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

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

	//Stores all the notes
	Notes map[template.URL]parser.Note

	//Stores the links of each note to other notes
	LinkStore map[template.URL][]*parser.Note

	// 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
}

func (*Engine) GenerateFeed

func (e *Engine) GenerateFeed()

func (*Engine) GenerateJSONIndex

func (e *Engine) GenerateJSONIndex(outFilePath string)

func (*Engine) GenerateLinkStore

func (e *Engine) GenerateLinkStore()

func (*Engine) GenerateNoteJSONIdex

func (e *Engine) GenerateNoteJSONIdex(outFilePath string)

func (*Engine) GenerateNoteRoot

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

func (*Engine) GenerateSitemap

func (e *Engine) GenerateSitemap(outFilePath string)

func (*Engine) RenderEngineGeneratedFiles

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

func (*Engine) RenderNotes

func (e *Engine) RenderNotes(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, templ *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