StaticPage

author: none

Mar 29, 2025


public protocol StaticPage: LayoutContent {
    var path: String { get }
    var title: String { get }
    var image: URL? { get }
    var description: String { get }
}

public protocol LayoutContent: Sendable {
    associatedtype Body: HTML
    @HTMLBuilder var body: Body { get }
    var layout: any Layout { get }
}


/*┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ StaticPage -> [BlockElement]                                                                     │
  │  |                                                                                               │
  │  +-- BlockElement: PageElement, HorizontalAligning                                               │
  │                                                                                                  │
  │         (Accordion, Alert, ButtonGroup, Card, Carousel, CodeBlock, ContrentPreview,              │
  │          Divider, Dropdown, Embed, Group, Image, Include, List, NavigationBar, Quote,            │
  │          Script, Section, Slide, Spacer, Table, Text)                                            │
  └──────────────────────────────────────────────────────────────────────────────────────────────────┘*/

/*┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
  │                                                                                                  │
  │ PageElement: BaseElement                                                                         │
  │                                                                                                  │
  │         (Body, Column, HTML, Item, ListItem, Row, Tag,                                           │
  │          HeadElement, InlineElement, HoriztalAlignment, LazyLoadable)                            │
  └──────────────────────────────────────────────────────────────────────────────────────────────────┘*/

/*┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ HorizontalAligning                                                                               │
  │                                                                                                  │
  │         (Column)                                                                                 │
  └──────────────────────────────────────────────────────────────────────────────────────────────────┘*/

/*┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
  │                                                                                                  │
  │ BaseElement                                                                                      │
  │  |                                                                                               │
  │  +-- func render(context: PublishingContext) -> String                                           │
  │                                                                                                  │
  └──────────────────────────────────────────────────────────────────────────────────────────────────┘*/

                                    (Component)