diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index 83b3c33..b81d2be 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -26,7 +26,7 @@ fn details(name: String, conn: DbConn, user: Option) -> Template { json!({ "post": p, "author": p.get_authors(&*conn)[0], - "url": p.compute_id(&*conn), + "url": format!("/~/{}/{}/", p.get_blog(&*conn).actor_id, p.slug), "date": p.creation_date.timestamp() }) }).collect::>() diff --git a/src/routes/instance.rs b/src/routes/instance.rs index aaa38e5..8925fc7 100644 --- a/src/routes/instance.rs +++ b/src/routes/instance.rs @@ -23,7 +23,7 @@ fn index(conn: DbConn, user: Option) -> Template { json!({ "post": p, "author": p.get_authors(&*conn)[0], - "url": p.compute_id(&*conn), + "url": format!("/~/{}/{}/", p.get_blog(&*conn).actor_id, p.slug), "date": p.creation_date.timestamp() }) }).collect::>() diff --git a/src/routes/user.rs b/src/routes/user.rs index 6907bd7..1b31b31 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -32,7 +32,7 @@ fn details(name: String, conn: DbConn, account: Option) -> Template { json!({ "post": p, "author": p.get_authors(&*conn)[0], - "url": p.compute_id(&*conn), + "url": format!("/~/{}/{}/", p.get_blog(&*conn).actor_id, p.slug), "date": p.creation_date.timestamp() }) }).collect::>(), diff --git a/static/main.css b/static/main.css index 9b5f9ee..6840322 100644 --- a/static/main.css +++ b/static/main.css @@ -21,6 +21,10 @@ header { justify-content: space-between; } +header #menu { + display: none; +} + header nav a { margin: 0px 20px; } @@ -101,3 +105,32 @@ textarea { padding: 5px 10px; margin: 0px 10px; } + +@media screen and (max-width: 500px) { + header { + padding: 20px 0px; + flex-direction: column; + } + + header #menu { + display: flex; + } + + header > nav { + display: none; + text-align: center; + } + + header nav a { + padding: 10px; + } + + header:focus-within > nav { + display: flex; + flex-direction: column; + } + + input { + width: 100%; + } +} diff --git a/templates/base.tera b/templates/base.tera index 766c76b..768242c 100644 --- a/templates/base.tera +++ b/templates/base.tera @@ -3,10 +3,12 @@ {% block title %}{% endblock title %} ⋅ Plume +
+