Added a list of posts
This commit is contained in:
parent
f72ff5820d
commit
3d61843d1c
9
App.go
9
App.go
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
@ -55,7 +56,13 @@ func (app *App) Run() {
|
||||
}
|
||||
|
||||
s.Get("/", func(ctx web.Context) error {
|
||||
return render(ctx, "<title>akyoto.dev</title>", markdown.Render("# Frontpage"))
|
||||
md := bytes.Buffer{}
|
||||
|
||||
for slug := range app.posts {
|
||||
fmt.Fprintf(&md, "- [%s](/%s)\n", slug, slug)
|
||||
}
|
||||
|
||||
return render(ctx, "<title>akyoto.dev</title>", markdown.Render(md.String()))
|
||||
})
|
||||
|
||||
s.Get("/:post", func(ctx web.Context) error {
|
||||
|
@ -8,7 +8,7 @@
|
||||
--grey-color: hsl(0, 0%, 61%);
|
||||
--highlight-color: hsla(0, 0%, 100%, 0.05);
|
||||
--body-color: hsl(220, 5%, 12%);
|
||||
--font-family: system-ui, sans-serif;
|
||||
--font-family: "Segoe UI", system-ui;
|
||||
--font-family-mono: monospace;
|
||||
--font-size: 18px;
|
||||
--line-height: 1.6;
|
||||
@ -139,8 +139,7 @@ th:empty {
|
||||
}
|
||||
|
||||
header,
|
||||
main,
|
||||
footer {
|
||||
main {
|
||||
width: 100%;
|
||||
max-width: var(--max-width);
|
||||
padding: var(--padding);
|
||||
@ -154,14 +153,6 @@ main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-size: 0.75em;
|
||||
color: var(--grey-color);
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
@ -188,6 +179,7 @@ time {
|
||||
|
||||
code {
|
||||
font-family: var(--font-family-mono);
|
||||
font-size: 80%;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user