feat: Style updates to articles list view.
All checks were successful
CI / release (push) Successful in 7m38s
All checks were successful
CI / release (push) Successful in 7m38s
This commit is contained in:
@@ -13,8 +13,13 @@ func tagPrefix(index: Int, totalTags: Int) -> Node {
|
||||
return ""
|
||||
}
|
||||
|
||||
func renderArticleInfo(_ article: Item<ArticleMetadata>) -> Node {
|
||||
div(class: "text-slate-400 text-sm mb-8") {
|
||||
enum RenderArticleInfoContext {
|
||||
case article
|
||||
case preview
|
||||
}
|
||||
|
||||
func renderArticleInfo(_ article: Item<ArticleMetadata>, context: RenderArticleInfoContext = .article) -> Node {
|
||||
div(class: "text-slate-400 text-sm mb-8\(context == .preview ? " -mt-2" : "")") {
|
||||
span(class: "border-r border-gray pr-2 mr-2") {
|
||||
article.getDate().formatted("MMMM dd, yyyy")
|
||||
}
|
||||
@@ -151,12 +156,12 @@ func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
|
||||
}
|
||||
|
||||
func renderArticleForGrid(article: Item<ArticleMetadata>, border: Bool = true) -> Node {
|
||||
div(class: "bg-slate-800\(border ? " border border-slate-400 rounded-lg" : "")") {
|
||||
section(class: "m-4") {
|
||||
h3(class: "post-title text-2xl font-bold mb-2") {
|
||||
div(class: "p-4 bg-slate-800\(border ? " border border-slate-400 rounded-lg" : "")") {
|
||||
section {
|
||||
h3(class: "text-2xl font-bold") {
|
||||
a(class: "[&:hover]:border-b border-green-500", href: article.url) { article.title }
|
||||
}
|
||||
renderArticleInfo(article)
|
||||
renderArticleInfo(article, context: .preview)
|
||||
p {
|
||||
a(href: article.url) {
|
||||
div {
|
||||
|
||||
Reference in New Issue
Block a user