articles, clean up, error fixes

This commit is contained in:
Rory Hinnen
2026-05-08 11:02:29 -05:00
parent 82b40351f0
commit 0ba6511d14
18 changed files with 189 additions and 202 deletions
+31
View File
@@ -0,0 +1,31 @@
//
// CustomStory.swift
// IgniteSamples
// https://www.github.com/twostraws/Ignite
// See LICENSE for license information.
//
import Foundation
import Ignite
struct CustomStory: ArticlePage {
var body: some HTML {
if let image = article.image {
Image(image, description: article.imageDescription)
.resizable()
}
Text(article.title)
.font(.title1)
if let tagLinks = article.tagLinks() {
HStack(spacing: .xSmall) {
ForEach(tagLinks) { link in
link.font(.title3)
}
}
}
Text(article.text)
}
}
+33
View File
@@ -0,0 +1,33 @@
//
// Story.swift
// IgniteSamples
// https://www.github.com/twostraws/Ignite
// See LICENSE for license information.
//
import Foundation
import Ignite
struct Story: ArticlePage {
var body: some HTML {
Text(article.title)
.font(.title1)
if let image = article.image {
Image(image, description: article.imageDescription)
.resizable()
.cornerRadius(20)
.frame(maxHeight: 300)
}
if let tags = article.tags {
Section {
Text("Tagged with: \(tags.joined(separator: ", "))")
Text("\(article.estimatedWordCount) words; \(article.estimatedReadingMinutes) minutes to read.")
}
}
Text(article.text)
}
}