feat: Ports all existing articles and images.

This commit is contained in:
2025-02-20 12:14:09 -05:00
parent e0fb6129ad
commit 67dc3540d6
151 changed files with 10413 additions and 1631 deletions

View File

@@ -28,7 +28,7 @@ func renderArticleForGrid(article: Item<ArticleMetadata>) -> Node {
p {
a(href: article.url) {
div {
img(alt: "banner", src: article.imagePath)
// img(alt: "banner", src: article.imagePath)
article.summary
}
}
@@ -56,7 +56,13 @@ func renderArticles(context: ItemsRenderingContext<ArticleMetadata>) -> Node {
}
}
func _renderArticles(_ articles: [Item<ArticleMetadata>], canocicalURL: String, title pageTitle: String, rssLink: String = "", extraHeader: NodeConvertible = Node.fragment([])) -> Node {
func _renderArticles(
_ articles: [Item<ArticleMetadata>],
canocicalURL: String,
title pageTitle: String,
rssLink: String = "",
extraHeader: NodeConvertible = Node.fragment([])
) -> Node {
return baseLayout(canocicalURL: canocicalURL, section: .articles, title: pageTitle, rssLink: rssLink, extraHeader: extraHeader) {
articles.map { article in
section(class: "mb-10") {
@@ -73,9 +79,20 @@ func _renderArticles(_ articles: [Item<ArticleMetadata>], canocicalURL: String,
}
func renderTag<T>(context: PartitionedRenderingContext<T, ArticleMetadata>) -> Node {
let extraHeader = link(href: "/articles/tag/\(context.key.slugified)/feed.xml", rel: "alternate", title: "\(SiteMetadata.name): articles with tag \(context.key)", type: "application/rss+xml")
let extraHeader = link(
href: "/articles/tag/\(context.key.slugified)/feed.xml",
rel: "alternate",
title: "\(SiteMetadata.name): articles with tag \(context.key)",
type: "application/rss+xml"
)
return _renderArticles(context.items, canocicalURL: "/articles/tag/\(context.key.slugified)/", title: "Articles in \(context.key)", rssLink: "tag/\(context.key.slugified)/", extraHeader: extraHeader)
return _renderArticles(
context.items,
canocicalURL: "/articles/tag/\(context.key.slugified)/",
title: "Articles in \(context.key)",
rssLink: "tag/\(context.key.slugified)/",
extraHeader: extraHeader
)
}
func renderYear<T>(context: PartitionedRenderingContext<T, ArticleMetadata>) -> Node {