feat: Adds favicons, updates styles, includes Avenir font.
This commit is contained in:
@@ -21,7 +21,7 @@ func baseLayout(
|
||||
.documentType("html"),
|
||||
html(lang: "en-US") {
|
||||
generateHeader(pageTitle, extraHeader)
|
||||
body(class: "bg-page text-white pb-5 font-avenir \(section.rawValue)") {
|
||||
body(class: "text-white text-lg pb-5 font-avenir \(section.rawValue)") {
|
||||
siteHeader(section)
|
||||
|
||||
div(class: "container") {
|
||||
@@ -59,9 +59,9 @@ private func siteHeader(_ section: Section) -> Node {
|
||||
}
|
||||
|
||||
private func footer(_ rssLink: String) -> Node {
|
||||
div(class: "site-footer text-slate-200 border-t border-light text-center pt-6 mt-8 text-sm") {
|
||||
div(class: "site-footer text-slate-400 border-t border-light text-center pt-2 text-sm") {
|
||||
div {
|
||||
"Copyright © Michael Housh 2023-\(Date().description.prefix(4))."
|
||||
"Copyright © Michael Housh \(Date().description.prefix(4))."
|
||||
}
|
||||
p(class: "mb-2") {
|
||||
"Built in Swift using"
|
||||
@@ -92,15 +92,33 @@ private func generateHeader(_ pageTitle: String, _ extraHeader: NodeConvertible)
|
||||
meta(content: "#0e1112", name: "theme-color", customAttributes: ["media": "(prefers-color-scheme: dark)"])
|
||||
meta(content: "#566B78", name: "theme-color", customAttributes: ["media": "(prefers-color-scheme: light)"])
|
||||
meta(content: "Michael Housh", name: "author")
|
||||
meta(content: "Mhoush", name: "apple-mobile-web-app-title")
|
||||
meta(content: "HHE-Docs", name: "apple-mobile-web-app-title")
|
||||
meta(content: "initial-scale=1.0, width=device-width", name: "viewport")
|
||||
meta(content: "telephone=no", name: "format-detection")
|
||||
meta(content: "True", name: "HandheldFriendly")
|
||||
meta(content: "320", name: "MobileOptimized")
|
||||
meta(content: "Mhoush", name: "og:site_name")
|
||||
meta(content: "HHE-Docs", name: "og:site_name")
|
||||
meta(content: "hvac, developer, swift, home-performance, design", name: "keywords")
|
||||
title { SiteMetadata.name + ": \(pageTitle)" }
|
||||
link(href: "/static/favicon.ico", rel: "shortcut icon")
|
||||
Node.raw("""
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/static/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/static/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/static/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/static/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/static/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/static/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/static/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/static/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/static/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/static/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
|
||||
<link rel="manifest" href="/static/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/static/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
""")
|
||||
link(href: "/static/output.css", rel: "stylesheet")
|
||||
link(href: "/static/style.css", rel: "stylesheet")
|
||||
link(href: "/articles/feed.xml", rel: "alternate", title: SiteMetadata.name, type: "application/rss+xml")
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ func renderArticles(context: ItemsRenderingContext<ArticleMetadata>) -> Node {
|
||||
sortedByYearDescending.map { year, articles in
|
||||
div {
|
||||
div(class: "border-b border-light flex flex-row gap-4 mb-12") {
|
||||
img(src: "/static/images/calendar.svg", width: "40")
|
||||
h1(class: "text-4xl font-extrabold") { year }
|
||||
img(src: "/static/img/calendar.svg", width: "40")
|
||||
h1(class: "text-4xl font-extrabold pt-3") { year }
|
||||
}
|
||||
|
||||
div(class: "grid gap-10 mb-16") {
|
||||
|
||||
@@ -27,8 +27,6 @@ func renderPage(context: ItemRenderingContext<PageMetadata>) -> Node {
|
||||
|
||||
func renderHome(body: String) -> Node {
|
||||
div {
|
||||
// img(alt: "Avatar", class: "my-24 w-[315px] h-200px mx-auto", src: "/static/images/avatar.png")
|
||||
|
||||
div(class: "my-24 uppercase font-avenir text-[40px] leading-[1.25] font-thin text-center [&>h1>strong]:font-bold") {
|
||||
Node.raw(body)
|
||||
}
|
||||
@@ -37,7 +35,7 @@ func renderHome(body: String) -> Node {
|
||||
|
||||
func renderNonHome(body: String) -> Node {
|
||||
article {
|
||||
div(class: "prose") {
|
||||
div(class: "font-avenir") {
|
||||
Node.raw(body)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user