/// A page of the website: an HTML document with the shared scaffolding assembled around the page's content.
///
/// A conforming page supplies its locale, its localized title, the stylesheets and scripts it needs, and its content; the protocol assembles the rest of the
/// document around them: the metadata, stylesheet, icon, and manifest links in the head, the content followed by the script tags in the body, and the
/// document language derived from the locale.
protocolPage:HTMLDocument,Sendable{
// MARK: Associated types
/// The type of the page's markup.
associatedtypeContent:HTML
// MARK: Properties
/// The page's markup, rendered before the ``scripts``.
@HTMLBuilder
varcontent:Content{get}
/// The locale the page content is localized to.
varlocale:Locale{get}
/// The scripts loaded at the end of the document body, in order.
varscripts:[StaticFile]{get}
/// The stylesheets linked in the document head, in order.
varstylesheets:[StaticFile]{get}
}
// MARK: - Implementations
extensionPage{
// MARK: Computed
/// The page ``content`` followed by its ``scripts``.
@HTMLBuilder
varbody:someHTML{
content
forfileinscripts{
script(.src(file.urlPath(for:.js))){}
}
}
/// The metadata, ``stylesheets``, icon, and manifest links placed in the document head.