🧑💻 Updated test site constructor, added logo/photo resources
This commit is contained in:
parent
a013c3a3fa
commit
d84563a515
|
@ -1,6 +1,7 @@
|
||||||
package domain
|
package domain
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"image"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -42,11 +43,34 @@ func TestSite(tb testing.TB) *Site {
|
||||||
DefaultLanguage: en,
|
DefaultLanguage: en,
|
||||||
Language: ru,
|
Language: ru,
|
||||||
Languages: []Language{en, ru},
|
Languages: []Language{en, ru},
|
||||||
BaseURL: &url.URL{Scheme: "http", Host: "127.0.0.1:3000", Path: "/"},
|
BaseURL: &url.URL{Scheme: "https", Host: "example.com", Path: "/"},
|
||||||
TimeZone: time.UTC,
|
TimeZone: time.UTC,
|
||||||
File: NewPath(filepath.Join("content", "index.en.md")),
|
File: NewPath(filepath.Join("content", "index.en.md")),
|
||||||
Title: "Testing",
|
Title: "Testing",
|
||||||
Resources: make([]*Resource, 0),
|
Resources: []*Resource{
|
||||||
|
{
|
||||||
|
modTime: time.Now().UTC().Add(-1 * time.Hour),
|
||||||
|
params: make(map[string]any),
|
||||||
|
File: NewPath("photo.png"),
|
||||||
|
mediaType: NewMediaType("image/png"),
|
||||||
|
key: "photo",
|
||||||
|
name: "photo",
|
||||||
|
resourceType: ResourceTypeImage,
|
||||||
|
title: "",
|
||||||
|
image: image.Config{},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modTime: time.Now().UTC().Add(-2 * time.Hour),
|
||||||
|
params: make(map[string]any),
|
||||||
|
File: NewPath("logo.jpg"),
|
||||||
|
mediaType: NewMediaType("image/jpeg"),
|
||||||
|
key: "logo",
|
||||||
|
name: "logo",
|
||||||
|
resourceType: ResourceTypeImage,
|
||||||
|
title: "",
|
||||||
|
image: image.Config{},
|
||||||
|
},
|
||||||
|
},
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"server": map[string]any{
|
"server": map[string]any{
|
||||||
"headers": []any{map[string]any{
|
"headers": []any{map[string]any{
|
||||||
|
|
Loading…
Reference in New Issue