cyanocorax/model/page/page.go

20 lines
325 B
Go

package page
import (
"strings"
)
type Page struct {
Title string `json:"title"`
Path string `json:"path"`
Content []string `json:"content"`
}
func (p *Page) GetPage() string {
return strings.Join(p.Content, "\n")
}
func (p *Page) SetPage(newContent string) {
p.Content = strings.Split(newContent, "\n")
}