summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-10-25 20:24:45 +0800
committereltrac <hi@eltr.ac>2026-10-25 21:12:48 +0800
commit5261c9c43cd03f9aace02e0b978c4ce4588f14d7 (patch)
tree04f519b6b9eda3c8e6af69d4446dd04f2f979d94
parent7c35081ca94b9c840969775e38ab3e7ad933435f (diff)
support slash pages
add slash pages
-rw-r--r--builder/base.scm59
-rw-r--r--content/pages.scm3
-rw-r--r--haunt.scm2
-rw-r--r--pages/donates.md21
-rw-r--r--pages/elsewhere.md36
-rw-r--r--pages/uses.md10
-rw-r--r--static/main.css59
7 files changed, 155 insertions, 35 deletions
diff --git a/builder/base.scm b/builder/base.scm
index 3ce2536..7eac10f 100644
--- a/builder/base.scm
+++ b/builder/base.scm
@@ -1,29 +1,46 @@
(define-module (builder base)
#:use-module (haunt site)
+ #:use-module (builder components)
#:export (base-template
- contained-template))
+ contained-template
+ page-template))
-(define (base-template site . content)
- `((doctype "html")
- (html (@ (lang "en"))
- (head
- (meta (@ (charset "utf-8")))
- (meta (@ (content "width=device-width,initial-scale=1")
- (name "viewport")))
- ;; fonts
- (link (@ (rel "preconnect")
- (href "https://fonts.bunny.net")))
- (link (@ (rel "stylesheet")
- (href "https://fonts.bunny.net/css?family=alegreya:400,400i,800,800i")))
- ;; stylesheet
- (link (@ (rel "stylesheet") (href "/static/normalize.css")))
- (link (@ (rel "stylesheet") (href "/static/reset.css")))
- (link (@ (rel "stylesheet") (href "/static/main.css")))
- (title ,(site-title site)))
- (body ,@content))))
+(define stylesheets
+ (list "https://fonts.bunny.net/css?family=alegreya:400,400i,800,800i"
+ "/static/normalize.css"
+ "/static/reset.css"
+ "/static/main.css"))
+
+(define (base-template site page-title . content)
+ (let ((title (if page-title
+ (string-append page-title " ยท " (site-title site))
+ (site-title site))))
+ `((doctype "html")
+ (html (@ (lang "en"))
+ (head
+ (meta (@ (charset "utf-8")))
+ (meta (@ (content "width=device-width,initial-scale=1")
+ (name "viewport")))
+ (link (@ (rel "preconnect")
+ (href "https://fonts.bunny.net")))
+ ;; stylesheet
+ ,@(map (lambda (uri)
+ `(link (@ (rel "stylesheet") (href ,uri)))) stylesheets)
+ (title ,title))
+ (body ,@content)))))
+
+(define (container content)
+ `(div (@ (class "container"))
+ ,@content))
(define (contained-template site . content)
+ (base-template site #f (container content)))
+
+(define (page-template site metadata body)
(base-template site
- `(div (@ (class "container"))
- ,@content)))
+ (assq-ref metadata 'title)
+ (container (list `(main (@ (class "page prose"))
+ ,body)
+ `(footer (@ (style "margin: 2rem 0"))
+ ,(link "/" "โ† Back to homepage"))))))
diff --git a/content/pages.scm b/content/pages.scm
index a1d67d1..167f57b 100644
--- a/content/pages.scm
+++ b/content/pages.scm
@@ -33,9 +33,8 @@
(small-prose
`(p "Check out some of my " ,(elink "https://slashpages.net/" "slash pages") " :3")
(linkline
- (slash "/contact")
- (slash "/uses")
(slash "/elsewhere")
+ (slash "/uses")
(slash "/donates")))
`(footer (@ (style "text-align: right; line-height: 1.5"))
(p "This page is still under construction. ๐Ÿšง")
diff --git a/haunt.scm b/haunt.scm
index 3fc75bd..a2b409f 100644
--- a/haunt.scm
+++ b/haunt.scm
@@ -18,7 +18,7 @@
(email . "hi@eltr.ac"))
#:readers (list commonmark-reader)
#:builders (list (blog)
- (flat-pages)
+ (flat-pages "pages" #:template page-template)
(static-directory "static")
(atom-feed)
(atom-feeds-by-tag)
diff --git a/pages/donates.md b/pages/donates.md
new file mode 100644
index 0000000..79a56f7
--- /dev/null
+++ b/pages/donates.md
@@ -0,0 +1,21 @@
+title: Donations
+index: true
+---
+
+# Donations
+
+I support these projects financially. I don't give much because I'm still a student. I think if everybody give one dollar to these great people every month, it would be very helpful.
+
+- [**Codeberg**](https://donate.codeberg.org/), a registered non-profit running infrastructure for FOSS projects. I pay membership fee to them since 2026.
+- **[imputnet](https://liberapay.com/imput/)**, the people behind [Helium browser](https://helium.computer/). They make great software.
+- **[@Zedeus](https://liberapay.com/zedeus/)**, the creator of [Nitter](https://github.com/zedeus/nitter). They really need help.
+
+Take a look at the open-source software you use every day, or the libraries they depend on.
+
+Open-source always needs funding. Sponsor creators you appreciate!
+
+---
+
+If you like what I do, consider tipping me on [Liberapay](https://liberapay.com/eltrac/) or [Ko-Fi](https://ko-fi.com/eltrac).
+
+
diff --git a/pages/elsewhere.md b/pages/elsewhere.md
new file mode 100644
index 0000000..ccf5494
--- /dev/null
+++ b/pages/elsewhere.md
@@ -0,0 +1,36 @@
+title: Elsewhere
+index: true
+---
+
+# Find me elsewhere
+
+You can talk me to via
+
+- **Email**: [hi@eltr.ac](mailto:hi@eltr.ac)
+- **Matrix**: [@eltrac:eltr.ac](https://matrix.to/#/@eltrac:eltr.ac)
+- **Fediverse**: [@eltrac@eltr.ac](https://akk.eltr.ac/@eltrac)
+
+ (Alternative account: [@eltrac@tech.lgbt](https://tech.lgbt/@eltrac))
+
+---
+
+Discover my projects on
+
+- **Codeberg**: [eltrac](https://codeberg.org/eltrac)
+- **Hydra**: [eltrac](https://src.eltr.ac/eltrac) (My [Forgejo](https://forgejo.org/) instance)
+- **GitHub**: [BigCoke233](https://github.com/BigCoke233)
+
+---
+
+Find out what I like through
+
+- **LastFM**: [eltrac](https://www.last.fm/user/eltrac)
+- **NeoDB**: [eltrac](https://neodb.social/users/Eltrac/)
+- **Steam**: [Eltrac](https://steamcommunity.com/profiles/76561198812226260/)
+
+---
+
+### Got keys? ๐Ÿ”‘
+
+Uh, I abandoned GPG for [various](https://gpg.fail/) [reasons](https://soatok.blog/2024/11/15/what-to-use-instead-of-pgp/). Now I don't really have a public key. I should probably get a `ed25519` key or something.
+
diff --git a/pages/uses.md b/pages/uses.md
new file mode 100644
index 0000000..a594080
--- /dev/null
+++ b/pages/uses.md
@@ -0,0 +1,10 @@
+title: Uses
+index: true
+---
+
+# Uses
+
+๐Ÿšง This page is under construction.
+
+Visit this old [/uses](/old/uses) for now. :3
+
diff --git a/static/main.css b/static/main.css
index 41381a9..167eebc 100644
--- a/static/main.css
+++ b/static/main.css
@@ -27,6 +27,54 @@ a {
margin: 5rem auto;
}
+.page {
+ font-size: 1.25rem;
+ line-height: 2;
+ @media screen and (min-width: 786px) {
+ border: 1px solid var(--decorative-color);
+ padding: 2rem;
+ background-color: var(--background-color);
+ }
+}
+
+.prose {
+ h1, h2, h3 {
+ font-weight: 800;
+ margin: 1rem 0;
+ }
+
+ h1 {
+ font-size: 2rem;
+ margin-top: 0;
+ margin-bottom: 1.5rem;
+ }
+
+ ul {
+ list-style: square;
+ padding-inline-start: 1.5rem;
+ margin: 1rem 0
+ }
+
+ em { font-style: italic; }
+ strong { font-weight: 800; }
+
+ hr {
+ border: 2px dashed var(--decorative-color);
+ margin: 1rem 0;
+ }
+}
+
+.prose-container {
+ font-size: 1.25rem;
+ line-height: 2;
+ width: 500px;
+ margin: 2rem auto;
+ &.small {
+ font-size: 1.15rem;
+ color: hsl(from var(--foreground-color) h calc(s - 10) calc(l + 30));
+ }
+}
+
.header {
@media screen and (min-width: 786px) {
display: flex;
@@ -87,17 +135,6 @@ a {
}
}
-.prose-container {
- font-size: 1.25rem;
- line-height: 2;
- width: 500px;
- margin: 2rem auto;
- &.small {
- font-size: 1.15rem;
- color: hsl(from var(--foreground-color) h calc(s - 10) calc(l + 30));
- }
-}
-
.linkbox {
display: flex;
align-items: center;