🏷️ Added IsHome property for Page domain
This commit is contained in:
parent
88e0dd02e9
commit
ea040738b4
|
@ -9,4 +9,5 @@ type Page struct {
|
|||
Title string
|
||||
Content []byte
|
||||
Resources Resources
|
||||
IsHome bool
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"strings"
|
||||
|
||||
"github.com/adrg/frontmatter"
|
||||
"golang.org/x/text/language"
|
||||
|
@ -66,5 +67,6 @@ func (repo *fileSystemPageRepository) Get(ctx context.Context, lang language.Tag
|
|||
Description: data.Description,
|
||||
Params: data.Params,
|
||||
Resources: make([]*domain.Resource, 0),
|
||||
IsHome: strings.HasPrefix(index, "index.") && strings.HasSuffix(index, ".md"),
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue