commit 803303fcf30139960a9c32d54e38302a93b7f58e
parent ca5303aee7e21b88e7a70990c8101f1c6c154375
Author: knutsen <samuel@knutsen.co>
Date: Sat, 20 Mar 2021 01:25:12 +0000
Add navigation bar.
Diffstat:
9 files changed, 64 insertions(+), 16 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,2 +1,5 @@
# Generated files
*.html
+
+# Archives
+*.tar*
diff --git a/Makefile b/Makefile
@@ -4,15 +4,12 @@ ifndef SEAM
$(error "`seam' executable not available. Please install")
endif
-HTML_FILES := index.html email.html
+HTML_FILES := index.html email.html about.html
all: clean $(HTML_FILES)
-index.html:
- $(SEAM) --html index.sex > index.html
-
-email.html:
- $(SEAM) --html email.sex > email.html
+%.html: %.sex
+ $(SEAM) --html $< > $@
install:
ifndef path
diff --git a/about.sex b/about.sex
@@ -0,0 +1,13 @@
+(%define title "About")
+
+(!DOCTYPE html)
+(html :lang en
+ (head
+ (%include "head"))
+ (body
+ (%include "header")
+ (div :id container
+ (%nav %title)
+ (p My name is Samuel.)
+ (img :src "https://knutsen.co/frcat.png" :alt "This is me.")
+ (%include "footer"))))
diff --git a/email.sex b/email.sex
@@ -1,12 +1,12 @@
+(%define title "E-mail")
(!DOCTYPE html)
(html :lang en
(head
- (%include "head.sex")
- (title Knutsen | E-mail))
+ (%include "head.sex"))
(body
(%include "header.sex")
(div :id container
- (h1 Authenticating)
+ (%nav Authenticating)
(p You'll need an E-mail client, such as
(a :href "https://www.thunderbird.net/" Thunderbird) \(for desktop\),
or (a :href "https://sparkmailapp.com/" Spark) \(for mobile\).)
diff --git a/footer.sex b/footer.sex
@@ -1,2 +1,3 @@
(footer
- (%include "date-mark.sex"))
+ (%include "source")
+ (%include "date-mark"))
diff --git a/head.sex b/head.sex
@@ -1,3 +1,26 @@
+(%define (nav title)
+ (nav (h1 %title)
+ (ul
+ (li (a :href "/" /home))
+ (li (a :href "/about" /about))
+ (li (a :href "/email" /email))
+ (li (a :href "https://canvas.knutsen.co" /canvas)))))
+
+(style
+ (nav :display flex
+ :justify-content space-between)
+ (nav h1 :font-size 2em
+ :display inline-block)
+ (nav ul :list-style none
+ :margin (auto 0)
+ :display inline-block)
+ (nav li :margin-left 0.5em
+ :display inline-block)
+ (nav li:before :display none))
+
+(%ifdef title
+ (title %title" | Knutsen")
+ (%log "No title set."))
(meta :http-equiv "Content-Type" :content "text/html; charset=UTF-8")
(meta :name viewport :content "width=device-width, initial-scale=1.0")
(link :rel icon :type image/png :href "favicon.png")
diff --git a/index.sex b/index.sex
@@ -1,12 +1,13 @@
+(%define title "Home")
+
(!DOCTYPE html)
(html :lang en
(head
- (%include "head.sex")
- (title Knutsen | Home))
+ (%include "head"))
(body
- (%include "header.sex")
+ (%include "header")
(div :id container
- (h1 Knutsen)
+ (%nav Knutsen)
(p This is the homepage for the Knutsen \(web, mail, &c.\)
server. Hosted on a (strong VPS) \(Virtual Private Server\)
somewhere in London.)
@@ -29,5 +30,5 @@
(p E-mail me any time, for questions about the server, the
website, or getting your own (code @knutsen.co) e-mail.)
(center (a :href "mailto:postmaster@knutsen.co" postmaster@knutsen.co))
- (%include "footer.sex"))))
+ (%include "footer"))))
diff --git a/source.sex b/source.sex
@@ -0,0 +1,10 @@
+(a :id source-code :href "https://git.knutsen.co/knutsen.co/files" source)
+
+(style
+ (#source-code
+ :position fixed
+ :bottom 1.8em
+ :left 2.2em
+ :color (rgba 0 0 0 0.4))
+ (#source-code:hover
+ :color (rgba 0 0 0 0.9)))
diff --git a/styles/main.sex b/styles/main.sex
@@ -39,7 +39,7 @@
:overflow auto
:padding (2em 1em)
:margin (auto 0 auto 0)
- :max-width 40em)
+ :width 40em)
(h1 , h2 , h3
:font-family ("Playfair Display SC" , serif)