personal-website/websiteapp/blogviewer/blogviewer.go

58 lines
1.1 KiB
Go
Raw Normal View History

2023-04-14 15:53:23 +00:00
package blogviewer
import (
"personalwebsite/websiteapp"
"github.com/gin-gonic/gin"
)
type BlogViewerApplication struct {
manifest websiteapp.ApplicationManifest
}
func NewBlogViewerApp() *BlogViewerApplication {
return &BlogViewerApplication{
manifest: websiteapp.ApplicationManifest{
AppId: "blog-viewer",
WindowName: "",
},
}
}
func (b *BlogViewerApplication) GetManifest() websiteapp.ApplicationManifest {
return b.manifest
}
func (b *BlogViewerApplication) GetId() string {
return b.manifest.AppId
}
func (b *BlogViewerApplication) Render(isMobile bool) gin.H {
mockBlocks := []Block{
{
BlockType: "plain-text",
Data: []string{"qwerty qwerty werty", "oiposi sdfsp sdfip"},
},
{
BlockType: "plain-text",
Data: []string{"perpoer", "kekekeke"},
},
{
BlockType: "plain-text",
Data: []string{"perpoer", "kekekeke"},
},
{
BlockType: "plain-text",
Data: []string{"perpoer", "kekekeke"},
},
}
return gin.H{
"header": "AAAAAA Header",
"blocks": mockBlocks,
}
}
type Block struct {
BlockType string
Data []string
}