summaryrefslogtreecommitdiff
path: root/website.templ
diff options
context:
space:
mode:
Diffstat (limited to 'website.templ')
-rw-r--r--website.templ34
1 files changed, 29 insertions, 5 deletions
diff --git a/website.templ b/website.templ
index 1371351..733aca1 100644
--- a/website.templ
+++ b/website.templ
@@ -23,7 +23,8 @@ templ HeadComponent(title string, description string) {
<script src="/public/theme.js" defer></script>
<script src="/public/scrollbar.js" defer></script>
<script src="/public/my_uptime.js" defer></script>
- <link rel="stylesheet" href="/public/style.css"/>
+ <script src="/public/footnotes.js" defer></script>
+ <link rel="stylesheet" href="/public/styles/style.css"/>
{ children... }
</head>
}
@@ -151,9 +152,7 @@ templ Nav(path string) {
templ TerminalLayout(style Style, path string) {
<!DOCTYPE html>
<html lang="en" style={ styleToCss(style) }>
- @HeadComponent(path, "My personal website") {
- <link rel="stylesheet" href="/public/styles/terminal.css"/>
- }
+ @HeadComponent(path, "My personal website")
<body>
<main class="flex flex-col w-[75rem] h-[40rem] p-8 border-[0.2rem] border-(--text) overflow-hidden text-[1.125rem]">
@Nav(path)
@@ -184,7 +183,7 @@ templ HomePage(style Style, latestBlog *Blog) {
@TerminalBorder("Profile", "", "[--border-py:0.875rem]") {
<div class="flex items-center gap-4 h-38">
<img src="/public/favicon.svg" alt="picture" class="h-full object-cover"/>
- @CopyPre(sshKey, "shrink-0 text-[0.675rem] leading-[normal]") {
+ @CopyPre(sshKey, "shrink-0 text-[0.675rem] leading-[1.32]") {
{ fingerprint }
}
</div>
@@ -750,3 +749,28 @@ templ Icon(color string) {
{ children... }
</svg>
}
+
+templ BlogPage(style Style, blog Blog, prev *Blog, next *Blog) {
+ @TerminalLayout(style, blog.Title) {
+ @ScrollBox("") {
+ @BlogItem("", blog, "mb-[1rem]")
+ <article class="prose select-text font-(family-name:--font-normal) text-[17.6px] leading-[1.7]">
+ @templ.Raw(blog.HTML)
+ </article>
+ <div class="grid grid-cols-2 gap-x-[1rem] mt-[1rem]">
+ @BlogNav("Previous Blog", prev, "")
+ @BlogNav("Next Blog", next, "")
+ </div>
+ }
+ }
+}
+
+templ BlogNav(label string, blog *Blog, extra string) {
+ if blog != nil {
+ @TerminalBorder(label, "", "min-w-0 "+extra) {
+ <a href={ templ.SafeURL("/blogs/" + blog.Slug) } class="block min-w-0 truncate">vim ~/blogs/{ blog.Slug }</a>
+ }
+ } else {
+ <div></div>
+ }
+}