feat: Ports all existing articles and images.
This commit is contained in:
@@ -78,6 +78,9 @@ private func footer(_ rssLink: String) -> Node {
|
||||
" | "
|
||||
a(href: "mailto:michael@mhoush.com", rel: "nofollow") { "Email" }
|
||||
}
|
||||
script(src: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js")
|
||||
script(src: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/keep-markup/prism-keep-markup.min.js")
|
||||
script(src: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user