package sitebuilder import ( "html/template" "io/fs" "time" "lmika.dev/lmika/weiro/models" "lmika.dev/lmika/weiro/models/pubmodel" ) 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 { // 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 pubmodel.Site } type postSingleData struct { commonData Meta *models.Post HTML template.HTML Path string } type postListData struct { commonData Posts []postSingleData } type layoutData struct { commonData Body template.HTML }