author: none
Mar 3, 2025
struct Card1: StaticPage {
var title = "Card1"
func body(context: PublishingContext) -> [BlockElement] {
Text("Hello world!").font(.title1)
Section {
for item in context.allContent {
ContentPreview(for: item)
.width(3)
.margin(.bottom)
}
}
/*┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 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)