feat: Adds favicons, updates styles, includes Avenir font.

This commit is contained in:
2025-04-03 09:56:33 -04:00
parent 548c534c67
commit 4d099909b6
40 changed files with 246 additions and 33 deletions

View File

@@ -85,12 +85,6 @@ private enum OtherArticles {
}
}
var tagSVG: Node {
Node.raw("""
<svg viewBox="0 0 33 33" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" fill="#5a5a5a" stroke="#5a5a5a"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <title>tag-2</title> <desc>Created with Sketch Beta.</desc> <defs> </defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"> <g id="Icon-Set" sketch:type="MSLayerGroup" transform="translate(-360.000000, -774.000000)" fill="#5b5b5b"> <path d="M390.097,789.321 C390.097,789.849 389.611,790.623 389.095,791.139 L378.823,801.378 L365.634,788.197 L375.89,777.974 C376.36,777.504 377.111,776.903 377.641,776.903 L389.139,776.903 C389.668,776.903 390.097,777.331 390.097,777.858 L390.097,789.321 L390.097,789.321 Z M375.89,804.304 C375.079,805.111 373.765,805.111 372.955,804.304 L362.684,794.063 C361.873,793.256 361.873,791.946 362.684,791.139 L364.166,789.66 L377.341,802.856 L375.89,804.304 L375.89,804.304 Z M390.097,774.993 L376.683,774.993 C375.624,774.993 375.431,775.455 374.422,776.511 L361.217,789.676 C359.596,791.291 359.596,793.911 361.217,795.526 L371.487,805.767 C373.108,807.382 375.735,807.382 377.356,805.767 L390.563,792.602 C391.412,791.754 392.014,791.332 392.014,790.276 L392.014,776.903 C392.014,775.849 391.155,774.993 390.097,774.993 L390.097,774.993 Z M383.959,786.019 C383.148,786.826 381.835,786.826 381.024,786.019 C380.214,785.211 380.214,783.901 381.024,783.093 C381.835,782.285 383.148,782.285 383.959,783.093 C384.77,783.901 384.77,785.211 383.959,786.019 L383.959,786.019 Z M379.558,781.63 C377.937,783.246 377.937,785.865 379.558,787.481 C381.178,789.097 383.806,789.097 385.427,787.481 C387.047,785.865 387.047,783.246 385.427,781.63 C383.806,780.015 381.178,780.015 379.558,781.63 L379.558,781.63 Z" id="tag-2" sketch:type="MSShapeGroup"> </path> </g> </g> </g></svg>
""")
}
func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
let otherArticles = parseOtherArticles(context)
@@ -100,12 +94,11 @@ func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
title: context.item.title,
extraHeader: generateHeader(.article(context.item))
) {
article(class: "prose pt-8") {
article(class: "pt-8 font-avenir text-lg") {
h1 { context.item.title }
div {
renderArticleInfo(context.item)
}
// img(alt: "banner", src: context.item.imagePath)
Node.raw(context.item.body)
}
@@ -115,7 +108,7 @@ func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
if let tag = otherArticles.tag {
a(href: "/articles/tag/\(tag)") {
div(class: " [&:hover]:border-b border-orange px-5 flex flex-row gap-5") {
img(src: "/static/images/tag.svg", width: "40")
img(src: "/static/img/tag.svg", width: "40")
span(class: "text-4xl font-extrabold text-orange") { tag }
}
}
@@ -126,11 +119,11 @@ func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
otherArticles.items.prefix(2).map { renderArticleForGrid(article: $0) }
}
div(class: "prose mt-10") {
div(class: "mt-10") {
a(href: "/articles/") {
div(class: "flex flex-row gap-2") {
span(class: "mt-8") { "All Articles" }
img(src: "/static/images/document.svg", width: "40")
span(class: "mt-4") { "All Articles" }
img(src: "/static/img/document.svg", width: "40")
}
}
}
@@ -141,13 +134,12 @@ func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
func renderArticleForGrid(article: Item<ArticleMetadata>) -> Node {
section {
h2(class: "post-title text-2xl font-bold mb-2") {
a(class: "[&:hover]:border-b border-orange", href: article.url) { article.title }
a(class: "[&:hover]:border-b border-orange-400", href: article.url) { article.title }
}
renderArticleInfo(article)
p {
a(href: article.url) {
div {
// img(alt: "banner", src: article.imagePath)
article.summary
}
}