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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@ -55,7 +56,13 @@ func (app *App) Run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s.Get("/", func(ctx web.Context) error {
|
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 {
|
s.Get("/:post", func(ctx web.Context) error {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
--grey-color: hsl(0, 0%, 61%);
|
--grey-color: hsl(0, 0%, 61%);
|
||||||
--highlight-color: hsla(0, 0%, 100%, 0.05);
|
--highlight-color: hsla(0, 0%, 100%, 0.05);
|
||||||
--body-color: hsl(220, 5%, 12%);
|
--body-color: hsl(220, 5%, 12%);
|
||||||
--font-family: system-ui, sans-serif;
|
--font-family: "Segoe UI", system-ui;
|
||||||
--font-family-mono: monospace;
|
--font-family-mono: monospace;
|
||||||
--font-size: 18px;
|
--font-size: 18px;
|
||||||
--line-height: 1.6;
|
--line-height: 1.6;
|
||||||
@ -139,8 +139,7 @@ th:empty {
|
|||||||
}
|
}
|
||||||
|
|
||||||
header,
|
header,
|
||||||
main,
|
main {
|
||||||
footer {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: var(--max-width);
|
max-width: var(--max-width);
|
||||||
padding: var(--padding);
|
padding: var(--padding);
|
||||||
@ -154,14 +153,6 @@ main {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 0.75em;
|
|
||||||
color: var(--grey-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
@ -188,6 +179,7 @@ time {
|
|||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: var(--font-family-mono);
|
font-family: var(--font-family-mono);
|
||||||
|
font-size: 80%;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user