🐛 Fixed language.Tag string representation usage

This commit is contained in:
Maxim Lebedev 2023-11-09 23:49:42 +06:00
parent 7df2c82882
commit 22047b7487
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
2 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,8 @@ func NewFileSystemPageRepository(rootDir fs.FS) page.Repository {
func (repo *fileSystemPageRepository) Get(ctx context.Context, lang language.Tag, p string) (*domain.Page, error) {
ext := ".md"
if lang != language.Und {
ext = "." + lang.String() + ext
base, _ := lang.Base()
ext = "." + base.String() + ext
}
index := p + ext

View File

@ -51,7 +51,8 @@ func NewFileSystemSiteRepository(rootDir fs.FS) site.Repository {
func (repo *fileSystemSiteRepository) Get(ctx context.Context, lang language.Tag) (*domain.Site, error) {
ext := ".md"
if lang != language.Und {
ext = "." + lang.String() + ext
base, _ := lang.Base()
ext = "." + base.String() + ext
}
target := "index" + ext