generator

package
v0.0.0-...-0e48e74 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DO_SEQUENTIALLY = true

DO_SEQUENTIALLY simplifies debugging by forcing all Generators to run sequentially - not concurrently - in func runTasks()

Functions

func WrapHtmlInMasterPageTemplate

func WrapHtmlInMasterPageTemplate(targs IndexHtmlMasterPageTemplateVariableArguments,
	blogProps SU.PropSet, dest string, t *template.Template) error

WrapHtmlInMasterPageTemplate writes an index.html file.

func WriteIndexHTML

func WriteIndexHTML(targs IndexHtmlMasterPageTemplateVariableArguments,
	blogProps SU.PropSet, destDirPath string, t *template.Template) error

WriteIndexHTML writes an index.html file.

Types

type BaseConfig

type BaseConfig struct {
	*template.Template
	Dest      string
	BlogProps SU.PropSet // *IndexWriter
}

func (*BaseConfig) String

func (bc *BaseConfig) String() string

type ByCountDesc

type ByCountDesc []*Tag

ByCountDesc sorts the tags.

func (ByCountDesc) Len

func (t ByCountDesc) Len() int

func (ByCountDesc) Less

func (t ByCountDesc) Less(i, j int) bool

func (ByCountDesc) Swap

func (t ByCountDesc) Swap(i, j int)

type ByDateDesc

type ByDateDesc []*Post

ByDateDesc is the sorting object for posts.

func (ByDateDesc) Len

func (p ByDateDesc) Len() int

func (ByDateDesc) Less

func (p ByDateDesc) Less(i, j int) bool

func (ByDateDesc) Swap

func (p ByDateDesc) Swap(i, j int)

type Generator

type Generator interface {
	Generate() error
}

Generator interface

type IndexHtmlMasterPageTemplateVariableArguments

type IndexHtmlMasterPageTemplateVariableArguments struct {
	HtmlTitle       string
	PageTitle       string
	MetaDesc        string
	HtmlContentFrag template.HTML
}

IndexHtmlMasterPageTemplateVariableArguments is variables passed to func WriteIndexHTML(..)

type IndexHtmlMasterPageTemplateVariables

type IndexHtmlMasterPageTemplateVariables struct {
	IndexHtmlMasterPageTemplateVariableArguments
	CanonLink string
	HiliteCSS template.CSS
	Name      string
	Year      int
}

IndexHtmlMasterPageTemplateVariables used to be IndexData: a data container for the landing page.

type ListingConfig

type ListingConfig struct {
	Posts     []*Post
	PageTitle string
	IsIndex   bool
	BaseConfig
}

ListingConfig holds the configuration for the listing page.

func (*ListingConfig) String

func (pLC *ListingConfig) String() string

type ListingData

type ListingData struct {
	Title      string
	Date       string
	Short      string
	Link       string
	TimeToRead string
	Tags       []*Tag
}

ListingData holds the data for the listing page.

type ListingGenerator

type ListingGenerator struct {
	Config *ListingConfig
}

ListingGenerator Object

func (*ListingGenerator) Generate

func (g *ListingGenerator) Generate() error

Generate starts the listing generation.

type Post

type Post struct {
	// Name      string
	Dir     *FU.BasicPath
	DirBase string
	File    *FU.BasicPath
	SU.PropSet
	ContentMD string
	CntAsHTML string
	ImagesDir string
	Images    []string
	// YAML "ParsedDate" is taken from the PropSet
	// as a string and then parsed into this field
	ParsedDate time.Time
}

Post holds data for a post.

type PostConfig

type PostConfig struct {
	Post *Post
	BaseConfig
}

PostConfig holds the post's configuration.

func (*PostConfig) String

func (pPC *PostConfig) String() string

type PostGenerator

type PostGenerator struct {
	Config *PostConfig
}

PostGenerator object

func (*PostGenerator) Generate

func (g *PostGenerator) Generate() error

Generate generates a post.

type RSSConfig

type RSSConfig struct {
	Posts     []*Post
	Dest      string
	BlogProps SU.PropSet
}

RSSConfig holds the configuration for an RSS feed.

type RSSGenerator

type RSSGenerator struct {
	Config *RSSConfig
}

RSSGenerator object

func (*RSSGenerator) Generate

func (g *RSSGenerator) Generate() error

Generate creates an RSS feed.

type SiteConfig

type SiteConfig struct {
	Sources []string
	Dest    string
	Configs []SU.PropSet
}

SiteConfig holds the sources and destination folder

type SiteGenerator

type SiteGenerator struct {
	StConfig *SiteConfig
}

SiteGenerator object

func New

func New(config *SiteConfig) *SiteGenerator

New creates a new SiteGenerator.

func (*SiteGenerator) Generate

func (g *SiteGenerator) Generate() error

Generate starts the static blog generation.

type SitemapConfig

type SitemapConfig struct {
	Posts       []*Post
	TagPostsMap map[string][]*Post
	Destination string
	BlogURL     string
	Statics     []string
}

SitemapConfig holds the config for the sitemap.

type SitemapGenerator

type SitemapGenerator struct {
	Config *SitemapConfig
}

SitemapGenerator object

func (*SitemapGenerator) Generate

func (g *SitemapGenerator) Generate() error

Generate creates the sitemap.

type StaticsConfig

type StaticsConfig struct {
	TmplsToFiles map[string]string
	BaseConfig
}

StaticsConfig holds the data for the static sites.

type StaticsGenerator

type StaticsGenerator struct {
	Config *StaticsConfig
}

StaticsGenerator object

func (*StaticsGenerator) Generate

func (g *StaticsGenerator) Generate() error

Generate creates the static pages.

type Tag

type Tag struct {
	Name  string
	Link  string
	Count int
}

Tag holds the data for a Tag.

type TagsConfig

type TagsConfig struct {
	TagPostsMap map[string][]*Post
	BaseConfig
}

TagsConfig holds the tag's config.

type TagsGenerator

type TagsGenerator struct {
	Config *TagsConfig
}

TagsGenerator object

func (*TagsGenerator) Generate

func (g *TagsGenerator) Generate() error

Generate creates the tags page.

Jump to

Keyboard shortcuts

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