39 lines
872 B
Swift
39 lines
872 B
Swift
//
|
|
// SuggestedArticlePage.swift
|
|
// IgniteSamples
|
|
// https://www.github.com/twostraws/Ignite
|
|
// See LICENSE for license information.
|
|
//
|
|
|
|
import Foundation
|
|
import Ignite
|
|
|
|
struct SuggestedArticleLayout: Layout {
|
|
@Environment(\.articles) private var articles
|
|
|
|
var body: some Document {
|
|
Body {
|
|
|
|
Grid(alignment: .top) {
|
|
content
|
|
.width(9)
|
|
.padding(.vertical, 80)
|
|
|
|
Section {
|
|
Text("Read this next…")
|
|
.font(.title3)
|
|
|
|
if let latest = articles.all.randomElement() {
|
|
ArticlePreview(for: latest)
|
|
}
|
|
}
|
|
.width(3)
|
|
.position(.stickyTop)
|
|
.padding(.top, 80)
|
|
}
|
|
|
|
IgniteFooter()
|
|
}
|
|
}
|
|
}
|