feat: Initial working site, with single network article.

This commit is contained in:
2025-04-02 14:24:40 -04:00
parent e66f29f910
commit 74147f8b67
16 changed files with 629 additions and 3015 deletions

View File

@@ -14,7 +14,7 @@ func tagPrefix(index: Int, totalTags: Int) -> Node {
}
func renderArticleInfo(_ article: Item<ArticleMetadata>) -> Node {
div(class: "text-gray gray-links text-sm") {
div(class: "text-slate-400 gray-links text-sm mb-8") {
span(class: "border-r border-gray pr-2 mr-2") {
article.date.formatted("MMMM dd, yyyy")
}
@@ -27,7 +27,7 @@ func renderArticleInfo(_ article: Item<ArticleMetadata>) -> Node {
Node.raw("""
<i class="fa fa-home"></i>
"""),
%a(class: "text-orange [&:hover]:border-b border-green", href: "/articles/tag/\(tag.slugified)/") {
%a(class: "text-orange-400 [&:hover]:border-b border-green-400", href: "/articles/tag/\(tag.slugified)/") {
tag
}
])
@@ -100,12 +100,12 @@ func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
title: context.item.title,
extraHeader: generateHeader(.article(context.item))
) {
article(class: "prose") {
article(class: "prose pt-8") {
h1 { context.item.title }
div(class: "-mt-6") {
div {
renderArticleInfo(context.item)
}
img(alt: "banner", src: context.item.imagePath)
// img(alt: "banner", src: context.item.imagePath)
Node.raw(context.item.body)
}
@@ -135,23 +135,6 @@ func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
}
}
}
// Giscus comment section.
commentSection
div(class: "border-t border-light mt-8 pt-8") {
h2(class: "text-4xl font-extrabold mb-8") { "Author" }
div(class: "flex flex-col lg:flex-row gap-8") {
div(class: "flex-[0_0_120px]") {
img(class: "w-[120px] h-[120px] rounded-full", src: "/static/images/avatar.png")
}
div(class: "prose") {
h3(class: "!m-0") { SiteMetadata.author }
p(class: "text-gray") { SiteMetadata.summary }
}
}
}
}
}
@@ -171,26 +154,3 @@ func renderArticleForGrid(article: Item<ArticleMetadata>) -> Node {
}
}
}
private var commentSection: Node {
div(class: "border-t border-light pt-8") {
Node.raw("""
<script src="https://giscus.app/client.js"
data-repo="m-housh/mhoush.com"
data-repo-id="R_kgDOJagAXA"
data-category="Article Discussions"
data-category-id="DIC_kwDOJagAXM4CnLfv"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="bottom"
data-theme="preferred_color_scheme"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async>
</script>
""")
}
}