Implemented phase 2 for the POC prototype in the Website service.

This commit is contained in:
javier committed 2026-09-21 11:44:58 +02:00
1 parent 09c7b8a1a7
commit 43dcc03da6
28 files changed
+1468 -65

No files matched your search

@@ -24,6 +24,9 @@ struct IndexPage {
/// The public origin the page derives its canonical URL and language alternates from, or `nil` to omit them.
let siteOrigin: String?
/// The signed-in viewer, or `nil` when signed out.
let viewer: Viewer?
/// Resolves the page's text from the bundled String Catalog for the page's ``locale``.
private let localize: Localize
@@ -36,13 +39,16 @@ struct IndexPage {
/// - siteOrigin: the public origin the page derives its canonical URL and language alternates from, or `nil` (the default) to omit them.
/// - analytics: the analytics tracker embedded in the document head, or `nil` (the default) to omit it.
/// - listings: the listings the page shows in its rows; none by default.
/// - viewer: the signed-in viewer, or `nil` (the default) when signed out.
init(
locale: Locale,
assetVersion: String? = nil,
siteOrigin: String? = nil,
analytics: Analytics? = nil,
listings: HomeListings = .init()
listings: HomeListings = .init(),
viewer: Viewer? = nil
) {
self.viewer = viewer
self.analytics = analytics
self.assetVersion = assetVersion
self.listings = listings
@@ -90,7 +96,7 @@ extension IndexPage: Page {
// MARK: Properties
var content: some HTML {
SiteLayout {
SiteLayout(viewer: viewer) {
div(.class("page home")) {
section(.class("hero")) {
div(.class("hero__text")) {