Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PageLink ¶
func PageLink(baseURL string, slugifier *slug.Slugifier, page TemplatePage) string
PageLink returns a link for the given page using its slugified title as filename.
func ReplaceExtension ¶
ReplaceExtension replaces the extension of path with ext. The given path remains unchanged if it does not end with a file extension. Note that ext is expected to start with a dot.
Types ¶
type Markdown ¶
type Markdown struct {
// contains filtered or unexported fields
}
Markdown renders markdown pages to HTML websites.
func NewMarkdown ¶
NewMarkdown returns an instantiated markdown renderer.
type TemplateData ¶
TemplateData contains data used to render page templates.
type TemplatePage ¶
type TemplatePage struct { Path string FM model.FrontMatter Markdown []byte }
func NewTemplatePage ¶
func NewTemplatePage(page *model.Page) TemplatePage
type Templates ¶
type Templates struct { // Page is a template for simple website pages. Page *template.Template // FeedPage is a template for a page used in a feed. FeedPage *template.Template // List is a template for list pages, e.g. a list of all blog articles. List *template.Template }
Templates are used by the Renderer to render HTML pages.
func NewTemplates ¶
NewTemplates parses templates from the given fs.FS and provides a set of default template functions. The template folder is expected to contain three files, base.gohtml, page.gohtml and list.gohtml, where base.gohtml will be shared by both, the page and list template.