package sitebuilder
import (
"html/template"
"io/fs"
"time"
"lmika.dev/lmika/weiro/models"
)
const (
// Template names
// tmplNamePostSingle is the template for single post (postSingleData)
tmplNamePostSingle = "posts_single.html"
// tmplNamePostList is the template for list of posts (postListData)
tmplNamePostList = "posts_list.html"
// tmplNameLayoutMain is the template for the main layout (layoutMainData)
tmplNameLayoutMain = "layout_main.html"
)
type Options struct {
SiteMeta models.SiteMeta
// BasePosts is the base path for posts.
BasePosts string
// TemplatesFS provides the raw templates for rendering the site.
TemplatesFS fs.FS
RenderTZ *time.Location
}
type commonData struct {
Site models.SiteMeta
}
type postSingleData struct {
commonData
Meta models.PostMeta
HTML template.HTML
Path string
}
type postListData struct {
commonData
Posts []postSingleData
}
type layoutData struct {
commonData
Body template.HTML
}