Documentation
¶
Index ¶
- Constants
- Variables
- func CopyDirectory(source, dest string) error
- func CopyFile(source, dest string)
- func CreateNewMarkdownFile(title string, path string)
- type BlogMetadata
- type BlogOption
- type BlogPost
- type BlogPostTemplateArgs
- type BlogRenderCache
- type BlogTemplateArgs
- type ExternalPostsMetadata
- type LinkMetadata
- type MarkdownRenderer
- type ProfileMetadata
- type SiteBuilder
- type TemplateRenderer
Constants ¶
View Source
const BASE_TEMPLATE = "/templates/base.tmpl"
View Source
const BLOG_BASE_PATH = "blog"
View Source
const BLOG_PAGE_TEMPLATE = "/templates/blog.tmpl"
View Source
const BLOG_POST_TEMPLATE = "/templates/blog_post.tmpl"
Variables ¶
View Source
var LINKS_PATH = "config/links.yml"
Functions ¶
func CopyDirectory ¶
func CreateNewMarkdownFile ¶
Types ¶
type BlogMetadata ¶
type BlogOption ¶
type BlogOption func(*BlogRenderCache)
func RenderUnpublished ¶
func RenderUnpublished() BlogOption
type BlogPost ¶
type BlogPost struct { Slug string Path string Body string Metadata BlogMetadata }
func (*BlogPost) FormatDate ¶
type BlogPostTemplateArgs ¶
type BlogPostTemplateArgs struct { Title string Body string Links LinkMetadata }
type BlogRenderCache ¶
type BlogRenderCache struct { Prefix string OutputPath string Items []BlogPost ShouldListUnpublished bool Links LinkMetadata // contains filtered or unexported fields }
func NewBlogRenderer ¶
func NewBlogRenderer(prefix string, outputPath string, filename string, opts ...BlogOption) *BlogRenderCache
func (*BlogRenderCache) Render ¶
func (b *BlogRenderCache) Render()
type BlogTemplateArgs ¶
type BlogTemplateArgs struct { Title string Body string BlogItems []BlogPost Links LinkMetadata }
type ExternalPostsMetadata ¶
type ExternalPostsMetadata struct { Title string `yaml:"title"` Link string `yaml:"link"` Date time.Time `yaml:"date"` }
func (ExternalPostsMetadata) FormatDate ¶
func (epm ExternalPostsMetadata) FormatDate() string
type LinkMetadata ¶
type LinkMetadata struct { Profiles []ProfileMetadata `yaml:"profiles"` External []ExternalPostsMetadata `yaml:"external_posts"` }
func NewLinks ¶
func NewLinks() LinkMetadata
type MarkdownRenderer ¶
type MarkdownRenderer struct {
// contains filtered or unexported fields
}
func NewMarkdownRenderer ¶
func NewMarkdownRenderer() MarkdownRenderer
type ProfileMetadata ¶
func (ProfileMetadata) SVGSource ¶
func (pm ProfileMetadata) SVGSource() string
type SiteBuilder ¶
type SiteBuilder struct { InputPath string OutputPath string BlogOptions []BlogOption }
func NewSiteBuilder ¶
func NewSiteBuilder(inputPath string, outputPath string) *SiteBuilder
func (SiteBuilder) Build ¶
func (b SiteBuilder) Build()
func (*SiteBuilder) WithBlogOptions ¶
func (b *SiteBuilder) WithBlogOptions(opts []BlogOption) *SiteBuilder
type TemplateRenderer ¶
type TemplateRenderer struct {
// contains filtered or unexported fields
}
func NewTemplateRenderer ¶
func NewTemplateRenderer(base string) *TemplateRenderer
func (*TemplateRenderer) AddTemplate ¶
func (t *TemplateRenderer) AddTemplate(paths ...string)
Click to show internal directories.
Click to hide internal directories.