Documentation
¶
Index ¶
- func StripFrontMatter(content []byte) []byte
- type IndexData
- type PostData
- type Views
- func (v *Views) AtomFeed(ctx context.Context, w io.Writer, articles []model.Article) error
- func (v *Views) Blog(ctx context.Context, w io.Writer, data *IndexData) error
- func (v *Views) Index(ctx context.Context, w io.Writer, data *IndexData) error
- func (v *Views) IndexFromArticles(articles []model.Article) *IndexData
- func (v *Views) Post(ctx context.Context, w io.Writer, data *PostData) error
- func (v *Views) PostFromArticle(article *model.Article, content string) *PostData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StripFrontMatter ¶
StripFrontMatter removes YAML front matter from content and returns just the body
Types ¶
type IndexData ¶
type IndexData struct {
Title string `json:"title"`
Description string `json:"description"`
OGImage string `json:"ogImage"`
Articles []model.Article `json:"articles"`
Total int `json:"total"`
}
IndexData holds the data required for rendering the index page
type PostData ¶
type PostData struct {
Slug string
Title string
Description string
OgImage string
Content string
Date *time.Time
Classnames string
}
PostData holds the data required for rendering the post layout
type Views ¶
func (*Views) IndexFromArticles ¶
IndexFromArticles creates IndexData from a list of articles
Click to show internal directories.
Click to hide internal directories.