🏷️ Added Translations property for Page domain
This commit is contained in:
parent
6080cce45f
commit
771f8721ca
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue