feat: Updates styles for sidebar and articles list view.
Some checks failed
CI / release (push) Failing after 2m31s

This commit is contained in:
2025-04-15 15:00:28 -04:00
parent 500f4746e8
commit ad81392dc7
5 changed files with 12 additions and 10 deletions

View File

@@ -2,8 +2,6 @@ import Foundation
import HTML import HTML
import Saga import Saga
// TODO: Try a sidebar with navigation to tags & years.
/// Displays lists of articles sectioned by a key. /// Displays lists of articles sectioned by a key.
/// ///
/// ///
@@ -66,9 +64,9 @@ struct ArticleGrid: NodeConvertible {
rssLink: rssLink, rssLink: rssLink,
extraHeader: extraHeader extraHeader: extraHeader
) { ) {
div(class: "grid grid-cols-4 mt-10 mb-10") { div(class: "grid grid-cols-4 -mt-2") {
// Sidebar // Sidebar
div(class: "overflow-auto bg-slate-800 rounded-l-lg border border-slate-200") { div(class: "overflow-auto border-r border-slate-200") {
// Years // Years
section(class: "pt-2") { section(class: "pt-2") {
div(class: "flex ps-2") { div(class: "flex ps-2") {
@@ -90,7 +88,7 @@ struct ArticleGrid: NodeConvertible {
} }
// Articles // Articles
div(class: "col-span-3 bg-slate-800 border border-slate-200 rounded-r-lg") { div(class: "col-span-3") {
articles.map { key, articles in articles.map { key, articles in
section { section {
header(key) header(key)

View File

@@ -58,7 +58,10 @@ private func siteHeader(_ section: Section) -> Node {
} }
} }
} }
// TODO: Explore search being hidden / triggered by a button and hover above
// the page content.
div(class: "font-avenir w-full pt-4 px-8", id: "search") {} div(class: "font-avenir w-full pt-4 px-8", id: "search") {}
div(class: "mt-2 mb-0 w-full border-b border-slate-200")
} }
} }
} }

View File

@@ -156,7 +156,8 @@ func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
} }
func renderArticleForGrid(article: Item<ArticleMetadata>, border: Bool = true) -> Node { func renderArticleForGrid(article: Item<ArticleMetadata>, border: Bool = true) -> Node {
div(class: "p-4 bg-slate-800\(border ? " border border-slate-400 rounded-lg" : "")") { // bg-slate-800
div(class: "p-4\(border ? " border border-slate-400 rounded-lg" : "")") {
section { section {
h3(class: "text-2xl font-bold") { h3(class: "text-2xl font-bold") {
a(class: "[&:hover]:border-b border-green-500", href: article.url) { article.title } a(class: "[&:hover]:border-b border-green-500", href: article.url) { article.title }

View File

@@ -34,7 +34,7 @@ func renderTag<T>(context: PartitionedRenderingContext<T, ArticleMetadata>) -> N
rssLink: "tag/\(context.key.slugified)/", rssLink: "tag/\(context.key.slugified)/",
extraHeader: extraHeader extraHeader: extraHeader
) { tag in ) { tag in
div(class: "border-b border-light mb-12 px-6 pt-6") { div(class: "mb-12 px-6 pt-6") {
a(href: "/articles") { a(href: "/articles") {
div(class: "flex flex-row gap-4") { div(class: "flex flex-row gap-4") {
img(src: "/static/img/tag.svg", width: "40") img(src: "/static/img/tag.svg", width: "40")
@@ -52,7 +52,7 @@ func renderYear<T>(context: PartitionedRenderingContext<T, ArticleMetadata>) ->
canocicalURL: "/articles/\(context.key)/", canocicalURL: "/articles/\(context.key)/",
title: "Articles in \(context.key)", title: "Articles in \(context.key)",
label: { year in label: { year in
div(class: "border-b border-light pt-6 w-full") { div(class: "pt-6 w-full") {
a(href: "/articles/") { a(href: "/articles/") {
div(class: "px-6 flex flex-row gap-4 ") { div(class: "px-6 flex flex-row gap-4 ") {
img(src: "/static/img/calendar.svg", width: "40") img(src: "/static/img/calendar.svg", width: "40")
@@ -66,7 +66,7 @@ func renderYear<T>(context: PartitionedRenderingContext<T, ArticleMetadata>) ->
} }
private func yearHeader(_ year: String) -> Node { private func yearHeader(_ year: String) -> Node {
div(class: "border-b border-light pt-6 w-full") { div(class: "pt-6 w-full") {
div(class: "px-6 flex flex-row gap-4 ") { div(class: "px-6 flex flex-row gap-4 ") {
img(src: "/static/img/calendar.svg", width: "40") img(src: "/static/img/calendar.svg", width: "40")
h1(class: "text-4xl font-extrabold pt-3") { year } h1(class: "text-4xl font-extrabold pt-3") { year }

File diff suppressed because one or more lines are too long