🏷️ Added Translations property for Page domain

This commit is contained in:
Maxim Lebedev 2023-11-11 23:49:47 +06:00
parent 6080cce45f
commit 771f8721ca
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 12 additions and 7 deletions

View File

@ -3,15 +3,20 @@ package domain
import "golang.org/x/text/language"
type Page struct {
Language language.Tag
Params map[string]any
File File
Description string
Title string
Content []byte
Resources Resources
Language language.Tag
Params map[string]any
File File
Description string
Title string
Content []byte
Resources Resources
Translations []*Page
}
func (p Page) IsHome() bool {
return p.File.dir == "./" && p.File.translationBaseName == "index"
}
func (p Page) IsTranslated() bool {
return 1 < len(p.Translations)
}