Documentation ¶
Index ¶
- func Day(datetime time.Time) string
- func Month(datetime time.Time) string
- func MonthAndYear(datetime time.Time) string
- func PrettyDate(datetime time.Time) string
- func PublishDate(datetime time.Time) string
- func TemplateFuncs() template.FuncMap
- func ToMarkdown(content string) template.HTML
- func Year(datetime time.Time) string
- type Config
- type Page
- type Site
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MonthAndYear ¶
MonthAndYear returns the month and year for a timestamp.
func PrettyDate ¶
PrettyDate returns a nicely rendered timestamp for this page, based on its date.
func PublishDate ¶
PublishDate returns a RSS friendly timestamp.
func TemplateFuncs ¶
TemplateFuncs returns a template.FuncMap of functions used in our templates.
func ToMarkdown ¶
ToMarkdown returns the passed content as a string containing HTML. This string is returned as a template.HTML value, so it is render directly in HTML templates, rather than being escaped.
Types ¶
type Config ¶
Config represents a site's configuration. A site's configuration must track the location (timezone) that it operates in, all of the available templates and the site wide variable.s
type Page ¶
type Page interface { Title() string Path() string Filename() string OutFilename() string ContentStart() int64 Content() (string, error) SetSite(site Site) Site() Site Template() string }
Page represents a page on the site. All pages should implement this interface, including blog posts, so as to enable the tree renderer to render them properly.
type Site ¶
type Site struct { Title string `json:"title"` Root string `json:"root"` Description string `json:"description"` BlogFeed string `json:"blog_feed"` AuthorName string `json:"author_name"` }
Site is a structure that contains global, site wide variables. These variables can be used in templates, and are used when rendering the blog's feed.
func (Site) Permalink ¶
Permalink returns the passed value as a permalink, with the value of site.Root prefixed.
For example, if a site is configured with "http://localhost" as the root, calling site.Permalink("a", "b", "c") will return "http://localhost/a/b/c".